db_id
stringclasses
140 values
schema
sequencelengths
0
26
question
stringlengths
16
224
query
stringlengths
18
577
query_toks
sequencelengths
4
90
query_toks_no_value
sequencelengths
4
125
question_toks
sequencelengths
4
44
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'.
SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%";
[ "SELECT", "T1.lesson_id", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id", "WHERE", "T2.first_name", "=", "``", "Janessa", "''", "AND", "T2.last_name", "=", "``", "Sawayn", "''", "AND", "nickname", "LIKE", "``", "%", "s", "%", "''", ";" ]
[ "select", "t1", ".", "lesson_id", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "where", "t2", ".", "first_name", "=", "value", "and", "t2", ".", "last_name", "=", "value", "and", "nickname", "like", "value" ]
[ "List", "lesson", "id", "of", "all", "lessons", "taught", "by", "staff", "with", "first", "name", "as", "Janessa", ",", "last", "name", "as", "Sawayn", "and", "nickname", "containing", "letter", "'s", "'", "." ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What are the the lesson ids of all staff taught by Janessa Sawayn whose nickname has the letter s?
SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%";
[ "SELECT", "T1.lesson_id", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id", "WHERE", "T2.first_name", "=", "``", "Janessa", "''", "AND", "T2.last_name", "=", "``", "Sawayn", "''", "AND", "nickname", "LIKE", "``", "%", "s", "%", "''", ";" ]
[ "select", "t1", ".", "lesson_id", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "where", "t2", ".", "first_name", "=", "value", "and", "t2", ".", "last_name", "=", "value", "and", "nickname", "like", "value" ]
[ "What", "are", "the", "the", "lesson", "ids", "of", "all", "staff", "taught", "by", "Janessa", "Sawayn", "whose", "nickname", "has", "the", "letter", "s", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
How many lessons taught by staff whose first name has letter 'a' in it?
SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%"
[ "SELECT", "count", "(", "*", ")", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id", "WHERE", "T2.first_name", "LIKE", "``", "%", "a", "%", "''" ]
[ "select", "count", "(", "*", ")", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "where", "t2", ".", "first_name", "like", "value" ]
[ "How", "many", "lessons", "taught", "by", "staff", "whose", "first", "name", "has", "letter", "'a", "'", "in", "it", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
How many lessons were taught by a staff member whose first name has the letter 'a' in it?
SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%"
[ "SELECT", "count", "(", "*", ")", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id", "WHERE", "T2.first_name", "LIKE", "``", "%", "a", "%", "''" ]
[ "select", "count", "(", "*", ")", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "where", "t2", ".", "first_name", "like", "value" ]
[ "How", "many", "lessons", "were", "taught", "by", "a", "staff", "member", "whose", "first", "name", "has", "the", "letter", "'a", "'", "in", "it", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn?
SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
[ "SELECT", "sum", "(", "lesson_time", ")", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id", "WHERE", "T2.first_name", "=", "``", "Janessa", "''", "AND", "T2.last_name", "=", "``", "Sawayn", "''", ";" ]
[ "select", "sum", "(", "lesson_time", ")", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "where", "t2", ".", "first_name", "=", "value", "and", "t2", ".", "last_name", "=", "value" ]
[ "How", "long", "is", "the", "total", "lesson", "time", "taught", "by", "staff", "with", "first", "name", "as", "Janessa", "and", "last", "name", "as", "Sawayn", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What is the total time for all lessons taught by Janessa Sawayn?
SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
[ "SELECT", "sum", "(", "lesson_time", ")", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id", "WHERE", "T2.first_name", "=", "``", "Janessa", "''", "AND", "T2.last_name", "=", "``", "Sawayn", "''", ";" ]
[ "select", "sum", "(", "lesson_time", ")", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "where", "t2", ".", "first_name", "=", "value", "and", "t2", ".", "last_name", "=", "value" ]
[ "What", "is", "the", "total", "time", "for", "all", "lessons", "taught", "by", "Janessa", "Sawayn", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What is average lesson price taught by staff with first name as Janessa and last name as Sawayn?
SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
[ "SELECT", "avg", "(", "price", ")", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id", "WHERE", "T2.first_name", "=", "``", "Janessa", "''", "AND", "T2.last_name", "=", "``", "Sawayn", "''", ";" ]
[ "select", "avg", "(", "price", ")", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "where", "t2", ".", "first_name", "=", "value", "and", "t2", ".", "last_name", "=", "value" ]
[ "What", "is", "average", "lesson", "price", "taught", "by", "staff", "with", "first", "name", "as", "Janessa", "and", "last", "name", "as", "Sawayn", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What is the average price for a lesson taught by Janessa Sawayn?
SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
[ "SELECT", "avg", "(", "price", ")", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id", "WHERE", "T2.first_name", "=", "``", "Janessa", "''", "AND", "T2.last_name", "=", "``", "Sawayn", "''", ";" ]
[ "select", "avg", "(", "price", ")", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id", "where", "t2", ".", "first_name", "=", "value", "and", "t2", ".", "last_name", "=", "value" ]
[ "What", "is", "the", "average", "price", "for", "a", "lesson", "taught", "by", "Janessa", "Sawayn", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
How many lesson does customer with first name Ray took?
SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray"
[ "SELECT", "count", "(", "*", ")", "FROM", "Lessons", "AS", "T1", "JOIN", "Customers", "AS", "T2", "ON", "T1.customer_id", "=", "T2.customer_id", "WHERE", "T2.first_name", "=", "``", "Ray", "''" ]
[ "select", "count", "(", "*", ")", "from", "lessons", "as", "t1", "join", "customers", "as", "t2", "on", "t1", ".", "customer_id", "=", "t2", ".", "customer_id", "where", "t2", ".", "first_name", "=", "value" ]
[ "How", "many", "lesson", "does", "customer", "with", "first", "name", "Ray", "took", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
How many lessons did the customer with the first name Ray take?
SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray"
[ "SELECT", "count", "(", "*", ")", "FROM", "Lessons", "AS", "T1", "JOIN", "Customers", "AS", "T2", "ON", "T1.customer_id", "=", "T2.customer_id", "WHERE", "T2.first_name", "=", "``", "Ray", "''" ]
[ "select", "count", "(", "*", ")", "from", "lessons", "as", "t1", "join", "customers", "as", "t2", "on", "t1", ".", "customer_id", "=", "t2", ".", "customer_id", "where", "t2", ".", "first_name", "=", "value" ]
[ "How", "many", "lessons", "did", "the", "customer", "with", "the", "first", "name", "Ray", "take", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
Which last names are both used by customers and by staff?
SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff
[ "SELECT", "last_name", "FROM", "Customers", "INTERSECT", "SELECT", "last_name", "FROM", "Staff" ]
[ "select", "last_name", "from", "customers", "intersect", "select", "last_name", "from", "staff" ]
[ "Which", "last", "names", "are", "both", "used", "by", "customers", "and", "by", "staff", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What are the last names that are used by customers and staff?
SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff
[ "SELECT", "last_name", "FROM", "Customers", "INTERSECT", "SELECT", "last_name", "FROM", "Staff" ]
[ "select", "last_name", "from", "customers", "intersect", "select", "last_name", "from", "staff" ]
[ "What", "are", "the", "last", "names", "that", "are", "used", "by", "customers", "and", "staff", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What is the first name of the staff who did not give any lesson?
SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id
[ "SELECT", "first_name", "FROM", "Staff", "EXCEPT", "SELECT", "T2.first_name", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id" ]
[ "select", "first_name", "from", "staff", "except", "select", "t2", ".", "first_name", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id" ]
[ "What", "is", "the", "first", "name", "of", "the", "staff", "who", "did", "not", "give", "any", "lesson", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What is the first name of all employees who do not give any lessons?
SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id
[ "SELECT", "first_name", "FROM", "Staff", "EXCEPT", "SELECT", "T2.first_name", "FROM", "Lessons", "AS", "T1", "JOIN", "Staff", "AS", "T2", "ON", "T1.staff_id", "=", "T2.staff_id" ]
[ "select", "first_name", "from", "staff", "except", "select", "t2", ".", "first_name", "from", "lessons", "as", "t1", "join", "staff", "as", "t2", "on", "t1", ".", "staff_id", "=", "t2", ".", "staff_id" ]
[ "What", "is", "the", "first", "name", "of", "all", "employees", "who", "do", "not", "give", "any", "lessons", "?" ]
driving_school
[ "CREATE TABLE `Addresses` (\n`address_id` INTEGER PRIMARY KEY,\n`line_1_number_building` VARCHAR(80),\n`city` VARCHAR(50),\n`zip_postcode` VARCHAR(20),\n`state_province_county` VARCHAR(50),\n`country` VARCHAR(50)\n);", "CREATE TABLE `Staff` (\n`staff_id` INTEGER PRIMARY KEY,\n`staff_address_id` INTEGER NOT NULL,\n`nickname` VARCHAR(80),\n`first_name` VARCHAR(80),\n`middle_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`date_of_birth` DATETIME,\n`date_joined_staff` DATETIME,\n`date_left_staff` DATETIME,\nFOREIGN KEY (`staff_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Vehicles` (\n`vehicle_id` INTEGER PRIMARY KEY,\n`vehicle_details` VARCHAR(255)\n);", "CREATE TABLE `Customers` (\n`customer_id` INTEGER PRIMARY KEY,\n`customer_address_id` INTEGER NOT NULL,\n`customer_status_code` VARCHAR(15) NOT NULL,\n`date_became_customer` DATETIME,\n`date_of_birth` DATETIME,\n`first_name` VARCHAR(80),\n`last_name` VARCHAR(80),\n`amount_outstanding` DOUBLE NULL,\n`email_address` VARCHAR(250),\n`phone_number` VARCHAR(255),\n`cell_mobile_phone_number` VARCHAR(255),\nFOREIGN KEY (`customer_address_id` ) REFERENCES `Addresses`(`address_id` )\n);", "CREATE TABLE `Customer_Payments` (\n`customer_id` INTEGER NOT NULL,\n`datetime_payment` DATETIME NOT NULL,\n`payment_method_code` VARCHAR(10) NOT NULL,\n`amount_payment` DOUBLE NULL,\nPRIMARY KEY (`customer_id`,`datetime_payment`),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);", "CREATE TABLE `Lessons` (\n`lesson_id` INTEGER PRIMARY KEY,\n`customer_id` INTEGER NOT NULL,\n`lesson_status_code` VARCHAR(15) NOT NULL,\n`staff_id` INTEGER,\n`vehicle_id` INTEGER NOT NULL,\n`lesson_date` DATETIME,\n`lesson_time` VARCHAR(10),\n`price` DOUBLE NULL,\nFOREIGN KEY (`vehicle_id` ) REFERENCES `Vehicles`(`vehicle_id` ),\nFOREIGN KEY (`staff_id` ) REFERENCES `Staff`(`staff_id` ),\nFOREIGN KEY (`customer_id` ) REFERENCES `Customers`(`customer_id` )\n);" ]
What is the id and detail of the vehicle used in lessons for most of the times?
SELECT T1.vehicle_id , T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.vehicle_id", ",", "T1.vehicle_details", "FROM", "Vehicles", "AS", "T1", "JOIN", "Lessons", "AS", "T2", "ON", "T1.vehicle_id", "=", "T2.vehicle_id", "GROUP", "BY", "T1.vehicle_id", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "vehicle_id", ",", "t1", ".", "vehicle_details", "from", "vehicles", "as", "t1", "join", "lessons", "as", "t2", "on", "t1", ".", "vehicle_id", "=", "t2", ".", "vehicle_id", "group", "by", "t1", ".", "vehicle_id", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "id", "and", "detail", "of", "the", "vehicle", "used", "in", "lessons", "for", "most", "of", "the", "times", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many faculty do we have?
SELECT count(*) FROM Faculty
[ "SELECT", "count", "(", "*", ")", "FROM", "Faculty" ]
[ "select", "count", "(", "*", ")", "from", "faculty" ]
[ "How", "many", "faculty", "do", "we", "have", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What is the total number of faculty members?
SELECT count(*) FROM Faculty
[ "SELECT", "count", "(", "*", ")", "FROM", "Faculty" ]
[ "select", "count", "(", "*", ")", "from", "faculty" ]
[ "What", "is", "the", "total", "number", "of", "faculty", "members", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What ranks do we have for faculty?
SELECT DISTINCT rank FROM Faculty
[ "SELECT", "DISTINCT", "rank", "FROM", "Faculty" ]
[ "select", "distinct", "rank", "from", "faculty" ]
[ "What", "ranks", "do", "we", "have", "for", "faculty", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the list of distinct ranks for faculty.
SELECT DISTINCT rank FROM Faculty
[ "SELECT", "DISTINCT", "rank", "FROM", "Faculty" ]
[ "select", "distinct", "rank", "from", "faculty" ]
[ "Find", "the", "list", "of", "distinct", "ranks", "for", "faculty", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show all the distinct buildings that have faculty rooms.
SELECT DISTINCT building FROM Faculty
[ "SELECT", "DISTINCT", "building", "FROM", "Faculty" ]
[ "select", "distinct", "building", "from", "faculty" ]
[ "Show", "all", "the", "distinct", "buildings", "that", "have", "faculty", "rooms", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What buildings have faculty offices?
SELECT DISTINCT building FROM Faculty
[ "SELECT", "DISTINCT", "building", "FROM", "Faculty" ]
[ "select", "distinct", "building", "from", "faculty" ]
[ "What", "buildings", "have", "faculty", "offices", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the rank, first name, and last name for all the faculty.
SELECT rank , Fname , Lname FROM Faculty
[ "SELECT", "rank", ",", "Fname", ",", "Lname", "FROM", "Faculty" ]
[ "select", "rank", ",", "fname", ",", "lname", "from", "faculty" ]
[ "Show", "the", "rank", ",", "first", "name", ",", "and", "last", "name", "for", "all", "the", "faculty", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the rank, first name, and last name of the faculty members?
SELECT rank , Fname , Lname FROM Faculty
[ "SELECT", "rank", ",", "Fname", ",", "Lname", "FROM", "Faculty" ]
[ "select", "rank", ",", "fname", ",", "lname", "from", "faculty" ]
[ "What", "are", "the", "rank", ",", "first", "name", ",", "and", "last", "name", "of", "the", "faculty", "members", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the first name, last name, and phone number for all female faculty members.
SELECT Fname , Lname , phone FROM Faculty WHERE Sex = 'F'
[ "SELECT", "Fname", ",", "Lname", ",", "phone", "FROM", "Faculty", "WHERE", "Sex", "=", "'F", "'" ]
[ "select", "fname", ",", "lname", ",", "phone", "from", "faculty", "where", "sex", "=", "value" ]
[ "Show", "the", "first", "name", ",", "last", "name", ",", "and", "phone", "number", "for", "all", "female", "faculty", "members", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the first name, last name, and phone number of all the female faculty members?
SELECT Fname , Lname , phone FROM Faculty WHERE Sex = 'F'
[ "SELECT", "Fname", ",", "Lname", ",", "phone", "FROM", "Faculty", "WHERE", "Sex", "=", "'F", "'" ]
[ "select", "fname", ",", "lname", ",", "phone", "from", "faculty", "where", "sex", "=", "value" ]
[ "What", "are", "the", "first", "name", ",", "last", "name", ",", "and", "phone", "number", "of", "all", "the", "female", "faculty", "members", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show ids for all the male faculty.
SELECT FacID FROM Faculty WHERE Sex = 'M'
[ "SELECT", "FacID", "FROM", "Faculty", "WHERE", "Sex", "=", "'M", "'" ]
[ "select", "facid", "from", "faculty", "where", "sex", "=", "value" ]
[ "Show", "ids", "for", "all", "the", "male", "faculty", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the faculty ids of all the male faculty members?
SELECT FacID FROM Faculty WHERE Sex = 'M'
[ "SELECT", "FacID", "FROM", "Faculty", "WHERE", "Sex", "=", "'M", "'" ]
[ "select", "facid", "from", "faculty", "where", "sex", "=", "value" ]
[ "What", "are", "the", "faculty", "ids", "of", "all", "the", "male", "faculty", "members", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many female Professors do we have?
SELECT count(*) FROM Faculty WHERE Sex = 'F' AND Rank = "Professor"
[ "SELECT", "count", "(", "*", ")", "FROM", "Faculty", "WHERE", "Sex", "=", "'F", "'", "AND", "Rank", "=", "``", "Professor", "''" ]
[ "select", "count", "(", "*", ")", "from", "faculty", "where", "sex", "=", "value", "and", "rank", "=", "value" ]
[ "How", "many", "female", "Professors", "do", "we", "have", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Count the number of female Professors we have.
SELECT count(*) FROM Faculty WHERE Sex = 'F' AND Rank = "Professor"
[ "SELECT", "count", "(", "*", ")", "FROM", "Faculty", "WHERE", "Sex", "=", "'F", "'", "AND", "Rank", "=", "``", "Professor", "''" ]
[ "select", "count", "(", "*", ")", "from", "faculty", "where", "sex", "=", "value", "and", "rank", "=", "value" ]
[ "Count", "the", "number", "of", "female", "Professors", "we", "have", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the phone, room, and building for the faculty named Jerry Prince.
SELECT phone , room , building FROM Faculty WHERE Fname = "Jerry" AND Lname = "Prince"
[ "SELECT", "phone", ",", "room", ",", "building", "FROM", "Faculty", "WHERE", "Fname", "=", "``", "Jerry", "''", "AND", "Lname", "=", "``", "Prince", "''" ]
[ "select", "phone", ",", "room", ",", "building", "from", "faculty", "where", "fname", "=", "value", "and", "lname", "=", "value" ]
[ "Show", "the", "phone", ",", "room", ",", "and", "building", "for", "the", "faculty", "named", "Jerry", "Prince", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the phone, room, and building of the faculty member called Jerry Prince?
SELECT phone , room , building FROM Faculty WHERE Fname = "Jerry" AND Lname = "Prince"
[ "SELECT", "phone", ",", "room", ",", "building", "FROM", "Faculty", "WHERE", "Fname", "=", "``", "Jerry", "''", "AND", "Lname", "=", "``", "Prince", "''" ]
[ "select", "phone", ",", "room", ",", "building", "from", "faculty", "where", "fname", "=", "value", "and", "lname", "=", "value" ]
[ "What", "are", "the", "phone", ",", "room", ",", "and", "building", "of", "the", "faculty", "member", "called", "Jerry", "Prince", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many Professors are in building NEB?
SELECT count(*) FROM Faculty WHERE Rank = "Professor" AND building = "NEB"
[ "SELECT", "count", "(", "*", ")", "FROM", "Faculty", "WHERE", "Rank", "=", "``", "Professor", "''", "AND", "building", "=", "``", "NEB", "''" ]
[ "select", "count", "(", "*", ")", "from", "faculty", "where", "rank", "=", "value", "and", "building", "=", "value" ]
[ "How", "many", "Professors", "are", "in", "building", "NEB", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Count the number of Professors who have office in building NEB.
SELECT count(*) FROM Faculty WHERE Rank = "Professor" AND building = "NEB"
[ "SELECT", "count", "(", "*", ")", "FROM", "Faculty", "WHERE", "Rank", "=", "``", "Professor", "''", "AND", "building", "=", "``", "NEB", "''" ]
[ "select", "count", "(", "*", ")", "from", "faculty", "where", "rank", "=", "value", "and", "building", "=", "value" ]
[ "Count", "the", "number", "of", "Professors", "who", "have", "office", "in", "building", "NEB", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the first name and last name for all the instructors.
SELECT fname , lname FROM Faculty WHERE Rank = "Instructor"
[ "SELECT", "fname", ",", "lname", "FROM", "Faculty", "WHERE", "Rank", "=", "``", "Instructor", "''" ]
[ "select", "fname", ",", "lname", "from", "faculty", "where", "rank", "=", "value" ]
[ "Show", "the", "first", "name", "and", "last", "name", "for", "all", "the", "instructors", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the first name and last name of all the instructors?
SELECT fname , lname FROM Faculty WHERE Rank = "Instructor"
[ "SELECT", "fname", ",", "lname", "FROM", "Faculty", "WHERE", "Rank", "=", "``", "Instructor", "''" ]
[ "select", "fname", ",", "lname", "from", "faculty", "where", "rank", "=", "value" ]
[ "What", "are", "the", "first", "name", "and", "last", "name", "of", "all", "the", "instructors", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show all the buildings along with the number of faculty members the buildings have.
SELECT building , count(*) FROM Faculty GROUP BY building
[ "SELECT", "building", ",", "count", "(", "*", ")", "FROM", "Faculty", "GROUP", "BY", "building" ]
[ "select", "building", ",", "count", "(", "*", ")", "from", "faculty", "group", "by", "building" ]
[ "Show", "all", "the", "buildings", "along", "with", "the", "number", "of", "faculty", "members", "the", "buildings", "have", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many faculty members does each building have? List the result with the name of the building.
SELECT building , count(*) FROM Faculty GROUP BY building
[ "SELECT", "building", ",", "count", "(", "*", ")", "FROM", "Faculty", "GROUP", "BY", "building" ]
[ "select", "building", ",", "count", "(", "*", ")", "from", "faculty", "group", "by", "building" ]
[ "How", "many", "faculty", "members", "does", "each", "building", "have", "?", "List", "the", "result", "with", "the", "name", "of", "the", "building", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Which building has most faculty members?
SELECT building FROM Faculty GROUP BY building ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "building", "FROM", "Faculty", "GROUP", "BY", "building", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "building", "from", "faculty", "group", "by", "building", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Which", "building", "has", "most", "faculty", "members", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the building that has the largest number of faculty members.
SELECT building FROM Faculty GROUP BY building ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "building", "FROM", "Faculty", "GROUP", "BY", "building", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "building", "from", "faculty", "group", "by", "building", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Find", "the", "building", "that", "has", "the", "largest", "number", "of", "faculty", "members", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show all the buildings that have at least 10 professors.
SELECT building FROM Faculty WHERE rank = "Professor" GROUP BY building HAVING count(*) >= 10
[ "SELECT", "building", "FROM", "Faculty", "WHERE", "rank", "=", "``", "Professor", "''", "GROUP", "BY", "building", "HAVING", "count", "(", "*", ")", ">", "=", "10" ]
[ "select", "building", "from", "faculty", "where", "rank", "=", "value", "group", "by", "building", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "Show", "all", "the", "buildings", "that", "have", "at", "least", "10", "professors", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
In which buildings are there at least ten professors?
SELECT building FROM Faculty WHERE rank = "Professor" GROUP BY building HAVING count(*) >= 10
[ "SELECT", "building", "FROM", "Faculty", "WHERE", "rank", "=", "``", "Professor", "''", "GROUP", "BY", "building", "HAVING", "count", "(", "*", ")", ">", "=", "10" ]
[ "select", "building", "from", "faculty", "where", "rank", "=", "value", "group", "by", "building", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "In", "which", "buildings", "are", "there", "at", "least", "ten", "professors", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
For each faculty rank, show the number of faculty members who have it.
SELECT rank , count(*) FROM Faculty GROUP BY rank
[ "SELECT", "rank", ",", "count", "(", "*", ")", "FROM", "Faculty", "GROUP", "BY", "rank" ]
[ "select", "rank", ",", "count", "(", "*", ")", "from", "faculty", "group", "by", "rank" ]
[ "For", "each", "faculty", "rank", ",", "show", "the", "number", "of", "faculty", "members", "who", "have", "it", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many faculty members do we have for each faculty rank?
SELECT rank , count(*) FROM Faculty GROUP BY rank
[ "SELECT", "rank", ",", "count", "(", "*", ")", "FROM", "Faculty", "GROUP", "BY", "rank" ]
[ "select", "rank", ",", "count", "(", "*", ")", "from", "faculty", "group", "by", "rank" ]
[ "How", "many", "faculty", "members", "do", "we", "have", "for", "each", "faculty", "rank", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show all the ranks and the number of male and female faculty for each rank.
SELECT rank , sex , count(*) FROM Faculty GROUP BY rank , sex
[ "SELECT", "rank", ",", "sex", ",", "count", "(", "*", ")", "FROM", "Faculty", "GROUP", "BY", "rank", ",", "sex" ]
[ "select", "rank", ",", "sex", ",", "count", "(", "*", ")", "from", "faculty", "group", "by", "rank", ",", "sex" ]
[ "Show", "all", "the", "ranks", "and", "the", "number", "of", "male", "and", "female", "faculty", "for", "each", "rank", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many faculty members do we have for each rank and gender?
SELECT rank , sex , count(*) FROM Faculty GROUP BY rank , sex
[ "SELECT", "rank", ",", "sex", ",", "count", "(", "*", ")", "FROM", "Faculty", "GROUP", "BY", "rank", ",", "sex" ]
[ "select", "rank", ",", "sex", ",", "count", "(", "*", ")", "from", "faculty", "group", "by", "rank", ",", "sex" ]
[ "How", "many", "faculty", "members", "do", "we", "have", "for", "each", "rank", "and", "gender", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Which rank has the smallest number of faculty members?
SELECT rank FROM Faculty GROUP BY rank ORDER BY count(*) ASC LIMIT 1
[ "SELECT", "rank", "FROM", "Faculty", "GROUP", "BY", "rank", "ORDER", "BY", "count", "(", "*", ")", "ASC", "LIMIT", "1" ]
[ "select", "rank", "from", "faculty", "group", "by", "rank", "order", "by", "count", "(", "*", ")", "asc", "limit", "value" ]
[ "Which", "rank", "has", "the", "smallest", "number", "of", "faculty", "members", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the faculty rank that has the least members.
SELECT rank FROM Faculty GROUP BY rank ORDER BY count(*) ASC LIMIT 1
[ "SELECT", "rank", "FROM", "Faculty", "GROUP", "BY", "rank", "ORDER", "BY", "count", "(", "*", ")", "ASC", "LIMIT", "1" ]
[ "select", "rank", "from", "faculty", "group", "by", "rank", "order", "by", "count", "(", "*", ")", "asc", "limit", "value" ]
[ "Find", "the", "faculty", "rank", "that", "has", "the", "least", "members", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the number of male and female assistant professors.
SELECT sex , count(*) FROM Faculty WHERE rank = "AsstProf" GROUP BY sex
[ "SELECT", "sex", ",", "count", "(", "*", ")", "FROM", "Faculty", "WHERE", "rank", "=", "``", "AsstProf", "''", "GROUP", "BY", "sex" ]
[ "select", "sex", ",", "count", "(", "*", ")", "from", "faculty", "where", "rank", "=", "value", "group", "by", "sex" ]
[ "Show", "the", "number", "of", "male", "and", "female", "assistant", "professors", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many male and female assistant professors do we have?
SELECT sex , count(*) FROM Faculty WHERE rank = "AsstProf" GROUP BY sex
[ "SELECT", "sex", ",", "count", "(", "*", ")", "FROM", "Faculty", "WHERE", "rank", "=", "``", "AsstProf", "''", "GROUP", "BY", "sex" ]
[ "select", "sex", ",", "count", "(", "*", ")", "from", "faculty", "where", "rank", "=", "value", "group", "by", "sex" ]
[ "How", "many", "male", "and", "female", "assistant", "professors", "do", "we", "have", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the first name and last name of Linda Smith's advisor?
SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith"
[ "SELECT", "T1.fname", ",", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "WHERE", "T2.fname", "=", "``", "Linda", "''", "AND", "T2.lname", "=", "``", "Smith", "''" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "where", "t2", ".", "fname", "=", "value", "and", "t2", ".", "lname", "=", "value" ]
[ "What", "are", "the", "first", "name", "and", "last", "name", "of", "Linda", "Smith", "'s", "advisor", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Who is the advisor of Linda Smith? Give me the first name and last name.
SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith"
[ "SELECT", "T1.fname", ",", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "WHERE", "T2.fname", "=", "``", "Linda", "''", "AND", "T2.lname", "=", "``", "Smith", "''" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "where", "t2", ".", "fname", "=", "value", "and", "t2", ".", "lname", "=", "value" ]
[ "Who", "is", "the", "advisor", "of", "Linda", "Smith", "?", "Give", "me", "the", "first", "name", "and", "last", "name", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the ids of students whose advisors are professors.
SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = "Professor"
[ "SELECT", "T2.StuID", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "WHERE", "T1.rank", "=", "``", "Professor", "''" ]
[ "select", "t2", ".", "stuid", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "where", "t1", ".", "rank", "=", "value" ]
[ "Show", "the", "ids", "of", "students", "whose", "advisors", "are", "professors", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Which students have professors as their advisors? Find their student ids.
SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = "Professor"
[ "SELECT", "T2.StuID", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "WHERE", "T1.rank", "=", "``", "Professor", "''" ]
[ "select", "t2", ".", "stuid", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "where", "t1", ".", "rank", "=", "value" ]
[ "Which", "students", "have", "professors", "as", "their", "advisors", "?", "Find", "their", "student", "ids", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show first name and last name for all the students advised by Michael Goodrich.
SELECT T2.fname , T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = "Michael" AND T1.lname = "Goodrich"
[ "SELECT", "T2.fname", ",", "T2.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "WHERE", "T1.fname", "=", "``", "Michael", "''", "AND", "T1.lname", "=", "``", "Goodrich", "''" ]
[ "select", "t2", ".", "fname", ",", "t2", ".", "lname", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "where", "t1", ".", "fname", "=", "value", "and", "t1", ".", "lname", "=", "value" ]
[ "Show", "first", "name", "and", "last", "name", "for", "all", "the", "students", "advised", "by", "Michael", "Goodrich", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Which students are advised by Michael Goodrich? Give me their first and last names.
SELECT T2.fname , T2.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.fname = "Michael" AND T1.lname = "Goodrich"
[ "SELECT", "T2.fname", ",", "T2.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "WHERE", "T1.fname", "=", "``", "Michael", "''", "AND", "T1.lname", "=", "``", "Goodrich", "''" ]
[ "select", "t2", ".", "fname", ",", "t2", ".", "lname", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "where", "t1", ".", "fname", "=", "value", "and", "t1", ".", "lname", "=", "value" ]
[ "Which", "students", "are", "advised", "by", "Michael", "Goodrich", "?", "Give", "me", "their", "first", "and", "last", "names", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the faculty id of each faculty member, along with the number of students he or she advises.
SELECT T1.FacID , count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID
[ "SELECT", "T1.FacID", ",", "count", "(", "*", ")", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "GROUP", "BY", "T1.FacID" ]
[ "select", "t1", ".", "facid", ",", "count", "(", "*", ")", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "group", "by", "t1", ".", "facid" ]
[ "Show", "the", "faculty", "id", "of", "each", "faculty", "member", ",", "along", "with", "the", "number", "of", "students", "he", "or", "she", "advises", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the faculty id and the number of students each faculty has?
SELECT T1.FacID , count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID
[ "SELECT", "T1.FacID", ",", "count", "(", "*", ")", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "GROUP", "BY", "T1.FacID" ]
[ "select", "t1", ".", "facid", ",", "count", "(", "*", ")", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "group", "by", "t1", ".", "facid" ]
[ "What", "are", "the", "faculty", "id", "and", "the", "number", "of", "students", "each", "faculty", "has", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show all the faculty ranks and the number of students advised by each rank.
SELECT T1.rank , count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank
[ "SELECT", "T1.rank", ",", "count", "(", "*", ")", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "GROUP", "BY", "T1.rank" ]
[ "select", "t1", ".", "rank", ",", "count", "(", "*", ")", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "group", "by", "t1", ".", "rank" ]
[ "Show", "all", "the", "faculty", "ranks", "and", "the", "number", "of", "students", "advised", "by", "each", "rank", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many students are advised by each rank of faculty? List the rank and the number of students.
SELECT T1.rank , count(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.rank
[ "SELECT", "T1.rank", ",", "count", "(", "*", ")", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "GROUP", "BY", "T1.rank" ]
[ "select", "t1", ".", "rank", ",", "count", "(", "*", ")", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "group", "by", "t1", ".", "rank" ]
[ "How", "many", "students", "are", "advised", "by", "each", "rank", "of", "faculty", "?", "List", "the", "rank", "and", "the", "number", "of", "students", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the first and last name of the faculty who has the most students?
SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.fname", ",", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "GROUP", "BY", "T1.FacID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "group", "by", "t1", ".", "facid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "are", "the", "first", "and", "last", "name", "of", "the", "faculty", "who", "has", "the", "most", "students", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Give me the the first and last name of the faculty who advises the most students.
SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.fname", ",", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "GROUP", "BY", "T1.FacID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "group", "by", "t1", ".", "facid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Give", "me", "the", "the", "first", "and", "last", "name", "of", "the", "faculty", "who", "advises", "the", "most", "students", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the ids for all the faculty members who have at least 2 students.
SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING count(*) >= 2
[ "SELECT", "T1.FacID", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "GROUP", "BY", "T1.FacID", "HAVING", "count", "(", "*", ")", ">", "=", "2" ]
[ "select", "t1", ".", "facid", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "group", "by", "t1", ".", "facid", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "Show", "the", "ids", "for", "all", "the", "faculty", "members", "who", "have", "at", "least", "2", "students", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Which faculty members advise two ore more students? Give me their faculty ids.
SELECT T1.FacID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor GROUP BY T1.FacID HAVING count(*) >= 2
[ "SELECT", "T1.FacID", "FROM", "Faculty", "AS", "T1", "JOIN", "Student", "AS", "T2", "ON", "T1.FacID", "=", "T2.advisor", "GROUP", "BY", "T1.FacID", "HAVING", "count", "(", "*", ")", ">", "=", "2" ]
[ "select", "t1", ".", "facid", "from", "faculty", "as", "t1", "join", "student", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "advisor", "group", "by", "t1", ".", "facid", "having", "count", "(", "*", ")", ">", "=", "value" ]
[ "Which", "faculty", "members", "advise", "two", "ore", "more", "students", "?", "Give", "me", "their", "faculty", "ids", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show ids for the faculty members who don't advise any student.
SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student
[ "SELECT", "FacID", "FROM", "Faculty", "EXCEPT", "SELECT", "advisor", "FROM", "Student" ]
[ "select", "facid", "from", "faculty", "except", "select", "advisor", "from", "student" ]
[ "Show", "ids", "for", "the", "faculty", "members", "who", "do", "n't", "advise", "any", "student", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the ids of the faculty members who do not advise any student.
SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student
[ "SELECT", "FacID", "FROM", "Faculty", "EXCEPT", "SELECT", "advisor", "FROM", "Student" ]
[ "select", "facid", "from", "faculty", "except", "select", "advisor", "from", "student" ]
[ "What", "are", "the", "ids", "of", "the", "faculty", "members", "who", "do", "not", "advise", "any", "student", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What activities do we have?
SELECT activity_name FROM Activity
[ "SELECT", "activity_name", "FROM", "Activity" ]
[ "select", "activity_name", "from", "activity" ]
[ "What", "activities", "do", "we", "have", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
List all the activities we have.
SELECT activity_name FROM Activity
[ "SELECT", "activity_name", "FROM", "Activity" ]
[ "select", "activity_name", "from", "activity" ]
[ "List", "all", "the", "activities", "we", "have", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many activities do we have?
SELECT count(*) FROM Activity
[ "SELECT", "count", "(", "*", ")", "FROM", "Activity" ]
[ "select", "count", "(", "*", ")", "from", "activity" ]
[ "How", "many", "activities", "do", "we", "have", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the number of activities available.
SELECT count(*) FROM Activity
[ "SELECT", "count", "(", "*", ")", "FROM", "Activity" ]
[ "select", "count", "(", "*", ")", "from", "activity" ]
[ "Find", "the", "number", "of", "activities", "available", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many faculty members participate in an activity?
SELECT count(DISTINCT FacID) FROM Faculty_participates_in
[ "SELECT", "count", "(", "DISTINCT", "FacID", ")", "FROM", "Faculty_participates_in" ]
[ "select", "count", "(", "distinct", "facid", ")", "from", "faculty_participates_in" ]
[ "How", "many", "faculty", "members", "participate", "in", "an", "activity", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Give me the number of faculty members who participate in an activity
SELECT count(DISTINCT FacID) FROM Faculty_participates_in
[ "SELECT", "count", "(", "DISTINCT", "FacID", ")", "FROM", "Faculty_participates_in" ]
[ "select", "count", "(", "distinct", "facid", ")", "from", "faculty_participates_in" ]
[ "Give", "me", "the", "number", "of", "faculty", "members", "who", "participate", "in", "an", "activity" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the ids of the faculty who don't participate in any activity.
SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
[ "SELECT", "FacID", "FROM", "Faculty", "EXCEPT", "SELECT", "FacID", "FROM", "Faculty_participates_in" ]
[ "select", "facid", "from", "faculty", "except", "select", "facid", "from", "faculty_participates_in" ]
[ "Show", "the", "ids", "of", "the", "faculty", "who", "do", "n't", "participate", "in", "any", "activity", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Which faculty do not participate in any activity? Find their faculty ids.
SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
[ "SELECT", "FacID", "FROM", "Faculty", "EXCEPT", "SELECT", "FacID", "FROM", "Faculty_participates_in" ]
[ "select", "facid", "from", "faculty", "except", "select", "facid", "from", "faculty_participates_in" ]
[ "Which", "faculty", "do", "not", "participate", "in", "any", "activity", "?", "Find", "their", "faculty", "ids", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the ids of all the faculty members who participate in an activity and advise a student.
SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student
[ "SELECT", "FacID", "FROM", "Faculty_participates_in", "INTERSECT", "SELECT", "advisor", "FROM", "Student" ]
[ "select", "facid", "from", "faculty_participates_in", "intersect", "select", "advisor", "from", "student" ]
[ "Show", "the", "ids", "of", "all", "the", "faculty", "members", "who", "participate", "in", "an", "activity", "and", "advise", "a", "student", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are ids of the faculty members who not only participate in an activity but also advise a student.
SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student
[ "SELECT", "FacID", "FROM", "Faculty_participates_in", "INTERSECT", "SELECT", "advisor", "FROM", "Student" ]
[ "select", "facid", "from", "faculty_participates_in", "intersect", "select", "advisor", "from", "student" ]
[ "What", "are", "ids", "of", "the", "faculty", "members", "who", "not", "only", "participate", "in", "an", "activity", "but", "also", "advise", "a", "student", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many activities does Mark Giuliano participate in?
SELECT count(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
[ "SELECT", "count", "(", "*", ")", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "WHERE", "T1.fname", "=", "``", "Mark", "''", "AND", "T1.lname", "=", "``", "Giuliano", "''" ]
[ "select", "count", "(", "*", ")", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "where", "t1", ".", "fname", "=", "value", "and", "t1", ".", "lname", "=", "value" ]
[ "How", "many", "activities", "does", "Mark", "Giuliano", "participate", "in", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the number of activities Mark Giuliano is involved in.
SELECT count(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
[ "SELECT", "count", "(", "*", ")", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "WHERE", "T1.fname", "=", "``", "Mark", "''", "AND", "T1.lname", "=", "``", "Giuliano", "''" ]
[ "select", "count", "(", "*", ")", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "where", "t1", ".", "fname", "=", "value", "and", "t1", ".", "lname", "=", "value" ]
[ "Find", "the", "number", "of", "activities", "Mark", "Giuliano", "is", "involved", "in", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the names of all the activities Mark Giuliano participates in.
SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
[ "SELECT", "T3.activity_name", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "JOIN", "Activity", "AS", "T3", "ON", "T3.actid", "=", "T2.actid", "WHERE", "T1.fname", "=", "``", "Mark", "''", "AND", "T1.lname", "=", "``", "Giuliano", "''" ]
[ "select", "t3", ".", "activity_name", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "join", "activity", "as", "t3", "on", "t3", ".", "actid", "=", "t2", ".", "actid", "where", "t1", ".", "fname", "=", "value", "and", "t1", ".", "lname", "=", "value" ]
[ "Show", "the", "names", "of", "all", "the", "activities", "Mark", "Giuliano", "participates", "in", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the names of the activities Mark Giuliano is involved in
SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN Activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
[ "SELECT", "T3.activity_name", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "JOIN", "Activity", "AS", "T3", "ON", "T3.actid", "=", "T2.actid", "WHERE", "T1.fname", "=", "``", "Mark", "''", "AND", "T1.lname", "=", "``", "Giuliano", "''" ]
[ "select", "t3", ".", "activity_name", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "join", "activity", "as", "t3", "on", "t3", ".", "actid", "=", "t2", ".", "actid", "where", "t1", ".", "fname", "=", "value", "and", "t1", ".", "lname", "=", "value" ]
[ "What", "are", "the", "names", "of", "the", "activities", "Mark", "Giuliano", "is", "involved", "in" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in.
SELECT T1.fname , T1.lname , count(*) , T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID
[ "SELECT", "T1.fname", ",", "T1.lname", ",", "count", "(", "*", ")", ",", "T1.FacID", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "GROUP", "BY", "T1.FacID" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", ",", "count", "(", "*", ")", ",", "t1", ".", "facid", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "group", "by", "t1", ".", "facid" ]
[ "Show", "the", "first", "and", "last", "name", "of", "all", "the", "faculty", "members", "who", "participated", "in", "some", "activity", ",", "together", "with", "the", "number", "of", "activities", "they", "participated", "in", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What is the first and last name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in.
SELECT T1.fname , T1.lname , count(*) , T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID
[ "SELECT", "T1.fname", ",", "T1.lname", ",", "count", "(", "*", ")", ",", "T1.FacID", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "GROUP", "BY", "T1.FacID" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", ",", "count", "(", "*", ")", ",", "t1", ".", "facid", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "group", "by", "t1", ".", "facid" ]
[ "What", "is", "the", "first", "and", "last", "name", "of", "the", "faculty", "members", "who", "participated", "in", "at", "least", "one", "activity", "?", "For", "each", "of", "them", ",", "also", "show", "the", "number", "of", "activities", "they", "participated", "in", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show all the activity names and the number of faculty involved in each activity.
SELECT T1.activity_name , count(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID
[ "SELECT", "T1.activity_name", ",", "count", "(", "*", ")", "FROM", "Activity", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.actID", "=", "T2.actID", "GROUP", "BY", "T1.actID" ]
[ "select", "t1", ".", "activity_name", ",", "count", "(", "*", ")", "from", "activity", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "actid", "=", "t2", ".", "actid", "group", "by", "t1", ".", "actid" ]
[ "Show", "all", "the", "activity", "names", "and", "the", "number", "of", "faculty", "involved", "in", "each", "activity", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
How many faculty members participate in each activity? Return the activity names and the number of faculty members.
SELECT T1.activity_name , count(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID
[ "SELECT", "T1.activity_name", ",", "count", "(", "*", ")", "FROM", "Activity", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.actID", "=", "T2.actID", "GROUP", "BY", "T1.actID" ]
[ "select", "t1", ".", "activity_name", ",", "count", "(", "*", ")", "from", "activity", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "actid", "=", "t2", ".", "actid", "group", "by", "t1", ".", "actid" ]
[ "How", "many", "faculty", "members", "participate", "in", "each", "activity", "?", "Return", "the", "activity", "names", "and", "the", "number", "of", "faculty", "members", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What is the first and last name of the faculty participating in the most activities?
SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.fname", ",", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "GROUP", "BY", "T1.FacID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "group", "by", "t1", ".", "facid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "first", "and", "last", "name", "of", "the", "faculty", "participating", "in", "the", "most", "activities", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the first and last name of the faculty who is involved in the largest number of activities.
SELECT T1.fname , T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.fname", ",", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "GROUP", "BY", "T1.FacID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "group", "by", "t1", ".", "facid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Find", "the", "first", "and", "last", "name", "of", "the", "faculty", "who", "is", "involved", "in", "the", "largest", "number", "of", "activities", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What is the name of the activity that has the most faculty members involved in?
SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.activity_name", "FROM", "Activity", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.actID", "=", "T2.actID", "GROUP", "BY", "T1.actID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "activity_name", "from", "activity", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "actid", "=", "t2", ".", "actid", "group", "by", "t1", ".", "actid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "activity", "that", "has", "the", "most", "faculty", "members", "involved", "in", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Which activity has the most faculty members participating in? Find the activity name.
SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.activity_name", "FROM", "Activity", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.actID", "=", "T2.actID", "GROUP", "BY", "T1.actID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "activity_name", "from", "activity", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "actid", "=", "t2", ".", "actid", "group", "by", "t1", ".", "actid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Which", "activity", "has", "the", "most", "faculty", "members", "participating", "in", "?", "Find", "the", "activity", "name", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the ids of the students who don't participate in any activity.
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in
[ "SELECT", "StuID", "FROM", "Student", "EXCEPT", "SELECT", "StuID", "FROM", "Participates_in" ]
[ "select", "stuid", "from", "student", "except", "select", "stuid", "from", "participates_in" ]
[ "Show", "the", "ids", "of", "the", "students", "who", "do", "n't", "participate", "in", "any", "activity", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the ids of the students who are not involved in any activity
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in
[ "SELECT", "StuID", "FROM", "Student", "EXCEPT", "SELECT", "StuID", "FROM", "Participates_in" ]
[ "select", "stuid", "from", "student", "except", "select", "stuid", "from", "participates_in" ]
[ "What", "are", "the", "ids", "of", "the", "students", "who", "are", "not", "involved", "in", "any", "activity" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Show the ids for all the students who participate in an activity and are under 20.
SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20
[ "SELECT", "StuID", "FROM", "Participates_in", "INTERSECT", "SELECT", "StuID", "FROM", "Student", "WHERE", "age", "<", "20" ]
[ "select", "stuid", "from", "participates_in", "intersect", "select", "stuid", "from", "student", "where", "age", "<", "value" ]
[ "Show", "the", "ids", "for", "all", "the", "students", "who", "participate", "in", "an", "activity", "and", "are", "under", "20", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the ids of the students who are under 20 years old and are involved in at least one activity.
SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age < 20
[ "SELECT", "StuID", "FROM", "Participates_in", "INTERSECT", "SELECT", "StuID", "FROM", "Student", "WHERE", "age", "<", "20" ]
[ "select", "stuid", "from", "participates_in", "intersect", "select", "stuid", "from", "student", "where", "age", "<", "value" ]
[ "What", "are", "the", "ids", "of", "the", "students", "who", "are", "under", "20", "years", "old", "and", "are", "involved", "in", "at", "least", "one", "activity", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What is the first and last name of the student participating in the most activities?
SELECT T1.fname , T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.fname", ",", "T1.lname", "FROM", "Student", "AS", "T1", "JOIN", "Participates_in", "AS", "T2", "ON", "T1.StuID", "=", "T2.StuID", "GROUP", "BY", "T1.StuID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", "from", "student", "as", "t1", "join", "participates_in", "as", "t2", "on", "t1", ".", "stuid", "=", "t2", ".", "stuid", "group", "by", "t1", ".", "stuid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "first", "and", "last", "name", "of", "the", "student", "participating", "in", "the", "most", "activities", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Tell me the first and last name of the student who has the most activities.
SELECT T1.fname , T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID = T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.fname", ",", "T1.lname", "FROM", "Student", "AS", "T1", "JOIN", "Participates_in", "AS", "T2", "ON", "T1.StuID", "=", "T2.StuID", "GROUP", "BY", "T1.StuID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "fname", ",", "t1", ".", "lname", "from", "student", "as", "t1", "join", "participates_in", "as", "t2", "on", "t1", ".", "stuid", "=", "t2", ".", "stuid", "group", "by", "t1", ".", "stuid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Tell", "me", "the", "first", "and", "last", "name", "of", "the", "student", "who", "has", "the", "most", "activities", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What is the name of the activity with the most students?
SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.activity_name", "FROM", "Activity", "AS", "T1", "JOIN", "Participates_in", "AS", "T2", "ON", "T1.actID", "=", "T2.actID", "GROUP", "BY", "T1.actID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "activity_name", "from", "activity", "as", "t1", "join", "participates_in", "as", "t2", "on", "t1", ".", "actid", "=", "t2", ".", "actid", "group", "by", "t1", ".", "actid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "What", "is", "the", "name", "of", "the", "activity", "with", "the", "most", "students", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the name of the activity that has the largest number of student participants.
SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID = T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1
[ "SELECT", "T1.activity_name", "FROM", "Activity", "AS", "T1", "JOIN", "Participates_in", "AS", "T2", "ON", "T1.actID", "=", "T2.actID", "GROUP", "BY", "T1.actID", "ORDER", "BY", "count", "(", "*", ")", "DESC", "LIMIT", "1" ]
[ "select", "t1", ".", "activity_name", "from", "activity", "as", "t1", "join", "participates_in", "as", "t2", "on", "t1", ".", "actid", "=", "t2", ".", "actid", "group", "by", "t1", ".", "actid", "order", "by", "count", "(", "*", ")", "desc", "limit", "value" ]
[ "Find", "the", "name", "of", "the", "activity", "that", "has", "the", "largest", "number", "of", "student", "participants", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the first names of the faculty members who are playing Canoeing or Kayaking.
SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
[ "SELECT", "DISTINCT", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "JOIN", "activity", "AS", "T3", "ON", "T2.actid", "=", "T2.actid", "WHERE", "T3.activity_name", "=", "'Canoeing", "'", "OR", "T3.activity_name", "=", "'Kayaking", "'" ]
[ "select", "distinct", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "join", "activity", "as", "t3", "on", "t2", ".", "actid", "=", "t2", ".", "actid", "where", "t3", ".", "activity_name", "=", "value", "or", "t3", ".", "activity_name", "=", "value" ]
[ "Find", "the", "first", "names", "of", "the", "faculty", "members", "who", "are", "playing", "Canoeing", "or", "Kayaking", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Which faculty members are playing either Canoeing or Kayaking? Tell me their first names.
SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
[ "SELECT", "DISTINCT", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "JOIN", "activity", "AS", "T3", "ON", "T2.actid", "=", "T2.actid", "WHERE", "T3.activity_name", "=", "'Canoeing", "'", "OR", "T3.activity_name", "=", "'Kayaking", "'" ]
[ "select", "distinct", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "join", "activity", "as", "t3", "on", "t2", ".", "actid", "=", "t2", ".", "actid", "where", "t3", ".", "activity_name", "=", "value", "or", "t3", ".", "activity_name", "=", "value" ]
[ "Which", "faculty", "members", "are", "playing", "either", "Canoeing", "or", "Kayaking", "?", "Tell", "me", "their", "first", "names", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the first names of professors who are not playing Canoeing or Kayaking.
SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
[ "SELECT", "lname", "FROM", "faculty", "WHERE", "rank", "=", "'Professor", "'", "EXCEPT", "SELECT", "DISTINCT", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "JOIN", "activity", "AS", "T3", "ON", "T2.actid", "=", "T2.actid", "WHERE", "T3.activity_name", "=", "'Canoeing", "'", "OR", "T3.activity_name", "=", "'Kayaking", "'" ]
[ "select", "lname", "from", "faculty", "where", "rank", "=", "value", "except", "select", "distinct", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "join", "activity", "as", "t3", "on", "t2", ".", "actid", "=", "t2", ".", "actid", "where", "t3", ".", "activity_name", "=", "value", "or", "t3", ".", "activity_name", "=", "value" ]
[ "Find", "the", "first", "names", "of", "professors", "who", "are", "not", "playing", "Canoeing", "or", "Kayaking", "." ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
What are the first names of the professors who do not play Canoeing or Kayaking as activities?
SELECT lname FROM faculty WHERE rank = 'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' OR T3.activity_name = 'Kayaking'
[ "SELECT", "lname", "FROM", "faculty", "WHERE", "rank", "=", "'Professor", "'", "EXCEPT", "SELECT", "DISTINCT", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "JOIN", "activity", "AS", "T3", "ON", "T2.actid", "=", "T2.actid", "WHERE", "T3.activity_name", "=", "'Canoeing", "'", "OR", "T3.activity_name", "=", "'Kayaking", "'" ]
[ "select", "lname", "from", "faculty", "where", "rank", "=", "value", "except", "select", "distinct", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "join", "activity", "as", "t3", "on", "t2", ".", "actid", "=", "t2", ".", "actid", "where", "t3", ".", "activity_name", "=", "value", "or", "t3", ".", "activity_name", "=", "value" ]
[ "What", "are", "the", "first", "names", "of", "the", "professors", "who", "do", "not", "play", "Canoeing", "or", "Kayaking", "as", "activities", "?" ]
activity_1
[ "create table Activity (\n actid INTEGER PRIMARY KEY,\n activity_name varchar(25)\n);", "create table Participates_in (\n stuid INTEGER,\n actid INTEGER,\n FOREIGN KEY(stuid) REFERENCES Student(StuID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Faculty_Participates_in (\n FacID INTEGER,\n actid INTEGER,\n FOREIGN KEY(FacID) REFERENCES Faculty(FacID),\n FOREIGN KEY(actid) REFERENCES Activity(actid)\n);", "create table Student (\n StuID INTEGER PRIMARY KEY,\n LName VARCHAR(12),\n Fname VARCHAR(12),\n Age INTEGER,\n Sex VARCHAR(1),\n Major INTEGER,\n Advisor INTEGER,\n city_code VARCHAR(3)\n );", "create table Faculty (\n FacID \t INTEGER PRIMARY KEY,\n Lname\t\tVARCHAR(15),\n Fname\t\tVARCHAR(15),\n Rank\t\tVARCHAR(15),\n Sex\t\tVARCHAR(1),\n Phone\t\tINTEGER,\n Room\t\tVARCHAR(5),\n Building\t\tVARCHAR(13)\n);" ]
Find the first names of the faculty members who participate in Canoeing and Kayaking.
SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID = T2.facID JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Kayaking'
[ "SELECT", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "JOIN", "activity", "AS", "T3", "ON", "T2.actid", "=", "T2.actid", "WHERE", "T3.activity_name", "=", "'Canoeing", "'", "INTERSECT", "SELECT", "T1.lname", "FROM", "Faculty", "AS", "T1", "JOIN", "Faculty_participates_in", "AS", "T2", "ON", "T1.facID", "=", "T2.facID", "JOIN", "activity", "AS", "T3", "ON", "T2.actid", "=", "T2.actid", "WHERE", "T3.activity_name", "=", "'Kayaking", "'" ]
[ "select", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "join", "activity", "as", "t3", "on", "t2", ".", "actid", "=", "t2", ".", "actid", "where", "t3", ".", "activity_name", "=", "value", "intersect", "select", "t1", ".", "lname", "from", "faculty", "as", "t1", "join", "faculty_participates_in", "as", "t2", "on", "t1", ".", "facid", "=", "t2", ".", "facid", "join", "activity", "as", "t3", "on", "t2", ".", "actid", "=", "t2", ".", "actid", "where", "t3", ".", "activity_name", "=", "value" ]
[ "Find", "the", "first", "names", "of", "the", "faculty", "members", "who", "participate", "in", "Canoeing", "and", "Kayaking", "." ]