Unnamed: 0
int64
0
60k
text
stringlengths
109
1.06k
1,700
<question>: How many institutions are there? <context>: CREATE TABLE inst (Id VARCHAR) <answer>: SELECT COUNT(*) FROM inst
1,701
<question>: How many papers are published in total? <context>: CREATE TABLE papers (Id VARCHAR) <answer>: SELECT COUNT(*) FROM papers
1,702
<question>: What are the titles of papers published by "Jeremy Gibbons"? <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR) <answer>: SELECT t3.title FROM authors AS t1 JOIN autho...
1,703
<question>: Find all the papers published by "Aaron Turon". <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR) <answer>: SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 O...
1,704
<question>: How many papers have "Atsushi Ohori" published? <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE papers (paperid VARCHAR) <answer>: SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t...
1,705
<question>: What is the name of the institution that "Matthias Blume" belongs to? <context>: CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR) <answer>: SELECT DISTINCT t3.name FROM authors AS t...
1,706
<question>: Which institution does "Katsuhiro Ueno" belong to? <context>: CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR) <answer>: SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship A...
1,707
<question>: Who belong to the institution "University of Oxford"? Show the first names and last names. <context>: CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR) <answer>: SELECT DISTINCT t1.f...
1,708
<question>: Which authors belong to the institution "Google"? Show the first names and last names. <context>: CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR) <answer>: SELECT DISTINCT t1.fname...
1,709
<question>: What are the last names of the author of the paper titled "Binders Unbound"? <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR) <answer>: SELECT t1.lname FROM authors AS t1 JOIN auth...
1,710
<question>: Find the first and last name of the author(s) who wrote the paper "Nameless, Painless". <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR) <answer>: SELECT t1.fname, t...
1,711
<question>: What are the papers published under the institution "Indiana University"? <context>: CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) <answer>: SELECT DISTINCT t1.title FROM papers AS t1 JOIN aut...
1,712
<question>: Find all the papers published by the institution "Google". <context>: CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) <answer>: SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 O...
1,713
<question>: How many papers are published by the institution "Tokohu University"? <context>: CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) <answer>: SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN ...
1,714
<question>: Find the number of papers published by the institution "University of Pennsylvania". <context>: CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) <answer>: SELECT COUNT(DISTINCT t1.title) FROM pap...
1,715
<question>: Find the papers which have "Olin Shivers" as an author. <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR) <answer>: SELECT t3.title FROM authors AS t1 JOIN authorship...
1,716
<question>: Which papers have "Stephanie Weirich" as an author? <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR) <answer>: SELECT t3.title FROM authors AS t1 JOIN authorship AS ...
1,717
<question>: Which paper is published in an institution in "USA" and have "Turon" as its second author? <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREA...
1,718
<question>: Find the titles of papers whose first author is affiliated with an institution in the country "Japan" and has last name "Ohori"? <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers ...
1,719
<question>: What is the last name of the author that has published the most papers? <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR) <answer>: SELECT t1.lname FROM authors AS t1 JOIN authorshi...
1,720
<question>: Retrieve the country that has published the most papers. <context>: CREATE TABLE inst (country VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR) <answer>: SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid...
1,721
<question>: Find the name of the organization that has published the largest number of papers. <context>: CREATE TABLE inst (name VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR) <answer>: SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t...
1,722
<question>: Find the titles of the papers that contain the word "ML". <context>: CREATE TABLE papers (title VARCHAR) <answer>: SELECT title FROM papers WHERE title LIKE "%ML%"
1,723
<question>: Which paper's title contains the word "Database"? <context>: CREATE TABLE papers (title VARCHAR) <answer>: SELECT title FROM papers WHERE title LIKE "%Database%"
1,724
<question>: Find the first names of all the authors who have written a paper with title containing the word "Functional". <context>: CREATE TABLE authors (fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR) <answer>: SELECT t1.f...
1,725
<question>: Find the last names of all the authors that have written a paper with title containing the word "Monadic". <context>: CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR) <answer>: SELECT t1.lnam...
1,726
<question>: Retrieve the title of the paper that has the largest number of authors. <context>: CREATE TABLE authorship (authorder INTEGER); CREATE TABLE authorship (paperid VARCHAR, authorder INTEGER); CREATE TABLE papers (title VARCHAR, paperid VARCHAR) <answer>: SELECT t2.title FROM authorship AS t1 JOIN papers AS t2...
1,727
<question>: What is the first name of the author with last name "Ueno"? <context>: CREATE TABLE authors (fname VARCHAR, lname VARCHAR) <answer>: SELECT fname FROM authors WHERE lname = "Ueno"
1,728
<question>: Find the last name of the author with first name "Amal". <context>: CREATE TABLE authors (lname VARCHAR, fname VARCHAR) <answer>: SELECT lname FROM authors WHERE fname = "Amal"
1,729
<question>: Find the first names of all the authors ordered in alphabetical order. <context>: CREATE TABLE authors (fname VARCHAR) <answer>: SELECT fname FROM authors ORDER BY fname
1,730
<question>: Retrieve all the last names of authors in alphabetical order. <context>: CREATE TABLE authors (lname VARCHAR) <answer>: SELECT lname FROM authors ORDER BY lname
1,731
<question>: Retrieve all the first and last names of authors in the alphabetical order of last names. <context>: CREATE TABLE authors (fname VARCHAR, lname VARCHAR) <answer>: SELECT fname, lname FROM authors ORDER BY lname
1,732
<question>: How many different last names do the actors and actresses have? <context>: CREATE TABLE actor (last_name VARCHAR) <answer>: SELECT COUNT(DISTINCT last_name) FROM actor
1,733
<question>: What is the most popular first name of the actors? <context>: CREATE TABLE actor (first_name VARCHAR) <answer>: SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1
1,734
<question>: What is the most popular full name of the actors? <context>: CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR) <answer>: SELECT first_name, last_name FROM actor GROUP BY first_name, last_name ORDER BY COUNT(*) DESC LIMIT 1
1,735
<question>: Which districts have at least two addresses? <context>: CREATE TABLE address (district VARCHAR) <answer>: SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2
1,736
<question>: What is the phone number and postal code of the address 1031 Daugavpils Parkway? <context>: CREATE TABLE address (phone VARCHAR, postal_code VARCHAR, address VARCHAR) <answer>: SELECT phone, postal_code FROM address WHERE address = '1031 Daugavpils Parkway'
1,737
<question>: Which city has the most addresses? List the city name, number of addresses, and city id. <context>: CREATE TABLE address (city_id VARCHAR); CREATE TABLE city (city VARCHAR, city_id VARCHAR) <answer>: SELECT T2.city, COUNT(*), T1.city_id FROM address AS T1 JOIN city AS T2 ON T1.city_id = T2.city_id GROUP BY ...
1,738
<question>: How many addresses are in the district of California? <context>: CREATE TABLE address (district VARCHAR) <answer>: SELECT COUNT(*) FROM address WHERE district = 'California'
1,739
<question>: Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id. <context>: CREATE TABLE film (title VARCHAR, film_id VARCHAR, rental_rate VARCHAR); CREATE TABLE inventory (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR) <answer>: SELECT title, fil...
1,740
<question>: How many cities are in Australia? <context>: CREATE TABLE country (country_id VARCHAR, country VARCHAR); CREATE TABLE city (country_id VARCHAR) <answer>: SELECT COUNT(*) FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id WHERE T2.country = 'Australia'
1,741
<question>: Which countries have at least 3 cities? <context>: CREATE TABLE country (country VARCHAR, country_id VARCHAR); CREATE TABLE city (country_id VARCHAR) <answer>: SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3
1,742
<question>: Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa. <context>: CREATE TABLE payment (payment_date VARCHAR, staff_id VARCHAR); CREATE TABLE staff (staff_id VARCHAR, first_name VARCHAR); CREATE TABLE payment (payment_da...
1,743
<question>: How many customers have an active value of 1? <context>: CREATE TABLE customer (active VARCHAR) <answer>: SELECT COUNT(*) FROM customer WHERE active = '1'
1,744
<question>: Which film has the highest rental rate? And what is the rate? <context>: CREATE TABLE film (title VARCHAR, rental_rate VARCHAR) <answer>: SELECT title, rental_rate FROM film ORDER BY rental_rate DESC LIMIT 1
1,745
<question>: Which film has the most number of actors or actresses? List the film name, film id and description. <context>: CREATE TABLE film_actor (film_id VARCHAR); CREATE TABLE film (title VARCHAR, film_id VARCHAR, description VARCHAR) <answer>: SELECT T2.title, T2.film_id, T2.description FROM film_actor AS T1 JOIN f...
1,746
<question>: Which film actor (actress) starred the most films? List his or her first name, last name and actor id. <context>: CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR) <answer>: SELECT T2.first_name, T2.last_name, T2.actor_id FROM film_actor...
1,747
<question>: Which film actors (actresses) played a role in more than 30 films? List his or her first name and last name. <context>: CREATE TABLE film_actor (actor_id VARCHAR); CREATE TABLE actor (first_name VARCHAR, last_name VARCHAR, actor_id VARCHAR) <answer>: SELECT T2.first_name, T2.last_name FROM film_actor AS T1 ...
1,748
<question>: Which store owns most items? <context>: CREATE TABLE inventory (store_id VARCHAR) <answer>: SELECT store_id FROM inventory GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1
1,749
<question>: What is the total amount of all payments? <context>: CREATE TABLE payment (amount INTEGER) <answer>: SELECT SUM(amount) FROM payment
1,750
<question>: Which customer, who has made at least one payment, has spent the least money? List his or her first name, last name, and the id. <context>: CREATE TABLE payment (customer_id VARCHAR); CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR) <answer>: SELECT T1.first_name, T1.last_n...
1,751
<question>: What is the genre name of the film HUNGER ROOF? <context>: CREATE TABLE film_category (category_id VARCHAR, film_id VARCHAR); CREATE TABLE film (film_id VARCHAR, title VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR) <answer>: SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON...
1,752
<question>: How many films are there in each category? List the genre name, genre id and the count. <context>: CREATE TABLE film_category (category_id VARCHAR); CREATE TABLE category (name VARCHAR, category_id VARCHAR) <answer>: SELECT T2.name, T1.category_id, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1...
1,753
<question>: Which film has the most copies in the inventory? List both title and id. <context>: CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (film_id VARCHAR) <answer>: SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id ORDER BY ...
1,754
<question>: What is the film title and inventory id of the item in the inventory which was rented most frequently? <context>: CREATE TABLE film (title VARCHAR, film_id VARCHAR); CREATE TABLE inventory (inventory_id VARCHAR, film_id VARCHAR); CREATE TABLE rental (inventory_id VARCHAR) <answer>: SELECT T1.title, T2.inven...
1,755
<question>: How many languages are in these films? <context>: CREATE TABLE film (language_id VARCHAR) <answer>: SELECT COUNT(DISTINCT language_id) FROM film
1,756
<question>: What are all the movies rated as R? List the titles. <context>: CREATE TABLE film (title VARCHAR, rating VARCHAR) <answer>: SELECT title FROM film WHERE rating = 'R'
1,757
<question>: Where is store 1 located? <context>: CREATE TABLE store (address_id VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR) <answer>: SELECT T2.address FROM store AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE store_id = 1
1,758
<question>: Which staff handled least number of payments? List the full name and the id. <context>: CREATE TABLE payment (staff_id VARCHAR); CREATE TABLE staff (first_name VARCHAR, last_name VARCHAR, staff_id VARCHAR) <answer>: SELECT T1.first_name, T1.last_name, T1.staff_id FROM staff AS T1 JOIN payment AS T2 ON T1.st...
1,759
<question>: Which language does the film AIRPORT POLLOCK use? List the language name. <context>: CREATE TABLE film (language_id VARCHAR, title VARCHAR); CREATE TABLE LANGUAGE (name VARCHAR, language_id VARCHAR) <answer>: SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id = T2.language_id WHERE T1.titl...
1,760
<question>: How many stores are there? <context>: CREATE TABLE store (Id VARCHAR) <answer>: SELECT COUNT(*) FROM store
1,761
<question>: How many kinds of different ratings are listed? <context>: CREATE TABLE film (rating VARCHAR) <answer>: SELECT COUNT(DISTINCT rating) FROM film
1,762
<question>: Which movies have 'Deleted Scenes' as a substring in the special feature? <context>: CREATE TABLE film (title VARCHAR, special_features VARCHAR) <answer>: SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'
1,763
<question>: How many items in inventory does store 1 have? <context>: CREATE TABLE inventory (store_id VARCHAR) <answer>: SELECT COUNT(*) FROM inventory WHERE store_id = 1
1,764
<question>: When did the first payment happen? <context>: CREATE TABLE payment (payment_date VARCHAR) <answer>: SELECT payment_date FROM payment ORDER BY payment_date LIMIT 1
1,765
<question>: Where does the customer with the first name Linda live? And what is her email? <context>: CREATE TABLE customer (email VARCHAR, address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR) <answer>: SELECT T2.address, T1.email FROM customer AS T1 JOIN address AS T2 ON ...
1,766
<question>: Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles. <context>: CREATE TABLE film (title VARCHAR, replacement_cost INTEGER, LENGTH VARCHAR, rating VARCHAR) <answer>: SELECT title FROM film WHERE LENGTH > 100 OR rating = 'PG' EXCEPT SE...
1,767
<question>: What is the first name and the last name of the customer who made the earliest rental? <context>: CREATE TABLE customer (first_name VARCHAR, last_name VARCHAR, customer_id VARCHAR); CREATE TABLE rental (customer_id VARCHAR, rental_date VARCHAR) <answer>: SELECT T1.first_name, T1.last_name FROM customer AS T...
1,768
<question>: What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns? <context>: CREATE TABLE customer (customer_id VARCHAR, first_name VARCHAR, last_name VARCHAR); CREATE TABLE rental (staff_id VARCHAR, customer_id VARCHAR); CREATE TABLE staff (fir...
1,769
<question>: Which store has most the customers? <context>: CREATE TABLE customer (store_id VARCHAR) <answer>: SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1
1,770
<question>: What is the largest payment amount? <context>: CREATE TABLE payment (amount VARCHAR) <answer>: SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
1,771
<question>: Where does the staff member with the first name Elsa live? <context>: CREATE TABLE staff (address_id VARCHAR, first_name VARCHAR); CREATE TABLE address (address VARCHAR, address_id VARCHAR) <answer>: SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name =...
1,772
<question>: What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'? <context>: CREATE TABLE customer (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER); CREATE TABLE rental (first_name VARCHAR, customer_id VARCHAR, rental_date INTEGER) <answer>: SELECT first_name FRO...
1,773
<question>: How many bank branches are there? <context>: CREATE TABLE bank (Id VARCHAR) <answer>: SELECT COUNT(*) FROM bank
1,774
<question>: How many customers are there? <context>: CREATE TABLE bank (no_of_customers INTEGER) <answer>: SELECT SUM(no_of_customers) FROM bank
1,775
<question>: Find the number of customers in the banks at New York City. <context>: CREATE TABLE bank (no_of_customers INTEGER, city VARCHAR) <answer>: SELECT SUM(no_of_customers) FROM bank WHERE city = 'New York City'
1,776
<question>: Find the average number of customers in all banks of Utah state. <context>: CREATE TABLE bank (no_of_customers INTEGER, state VARCHAR) <answer>: SELECT AVG(no_of_customers) FROM bank WHERE state = 'Utah'
1,777
<question>: Find the average number of customers cross all banks. <context>: CREATE TABLE bank (no_of_customers INTEGER) <answer>: SELECT AVG(no_of_customers) FROM bank
1,778
<question>: Find the city and state of the bank branch named morningside. <context>: CREATE TABLE bank (city VARCHAR, state VARCHAR, bname VARCHAR) <answer>: SELECT city, state FROM bank WHERE bname = 'morningside'
1,779
<question>: Find the branch names of banks in the New York state. <context>: CREATE TABLE bank (bname VARCHAR, state VARCHAR) <answer>: SELECT bname FROM bank WHERE state = 'New York'
1,780
<question>: List the name of all customers sorted by their account balance in ascending order. <context>: CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR) <answer>: SELECT cust_name FROM customer ORDER BY acc_bal
1,781
<question>: List the name of all different customers who have some loan sorted by their total loan amount. <context>: CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR) <answer>: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_...
1,782
<question>: Find the state, account type, and credit score of the customer whose number of loan is 0. <context>: CREATE TABLE customer (state VARCHAR, acc_type VARCHAR, credit_score VARCHAR, no_of_loans VARCHAR) <answer>: SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0
1,783
<question>: Find the number of different cities which banks are located at. <context>: CREATE TABLE bank (city VARCHAR) <answer>: SELECT COUNT(DISTINCT city) FROM bank
1,784
<question>: Find the number of different states which banks are located at. <context>: CREATE TABLE bank (state VARCHAR) <answer>: SELECT COUNT(DISTINCT state) FROM bank
1,785
<question>: How many distinct types of accounts are there? <context>: CREATE TABLE customer (acc_type VARCHAR) <answer>: SELECT COUNT(DISTINCT acc_type) FROM customer
1,786
<question>: Find the name and account balance of the customer whose name includes the letter ‘a’. <context>: CREATE TABLE customer (cust_name VARCHAR, acc_bal VARCHAR) <answer>: SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%'
1,787
<question>: Find the total account balance of each customer from Utah or Texas. <context>: CREATE TABLE customer (acc_bal INTEGER, state VARCHAR) <answer>: SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas'
1,788
<question>: Find the name of customers who have both saving and checking account types. <context>: CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR) <answer>: SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking'
1,789
<question>: Find the name of customers who do not have an saving account. <context>: CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR) <answer>: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving'
1,790
<question>: Find the name of customers who do not have a loan with a type of Mortgages. <context>: CREATE TABLE loan (cust_id VARCHAR, loan_type VARCHAR); CREATE TABLE customer (cust_name VARCHAR); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR) <answer>: SELECT cust_name FROM customer EXCEPT SELECT T1.cust_...
1,791
<question>: Find the name of customers who have loans of both Mortgages and Auto. <context>: CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR); CREATE TABLE loan (cust_id VARCHAR) <answer>: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSEC...
1,792
<question>: Find the name of customers whose credit score is below the average credit scores of all customers. <context>: CREATE TABLE customer (cust_name VARCHAR, credit_score INTEGER) <answer>: SELECT cust_name FROM customer WHERE credit_score < (SELECT AVG(credit_score) FROM customer)
1,793
<question>: Find the branch name of the bank that has the most number of customers. <context>: CREATE TABLE bank (bname VARCHAR, no_of_customers VARCHAR) <answer>: SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
1,794
<question>: Find the name of customer who has the lowest credit score. <context>: CREATE TABLE customer (cust_name VARCHAR, credit_score VARCHAR) <answer>: SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
1,795
<question>: Find the name, account type, and account balance of the customer who has the highest credit score. <context>: CREATE TABLE customer (cust_name VARCHAR, acc_type VARCHAR, acc_bal VARCHAR, credit_score VARCHAR) <answer>: SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
1,796
<question>: Find the name of customer who has the highest amount of loans. <context>: CREATE TABLE loan (cust_id VARCHAR, amount INTEGER); CREATE TABLE customer (cust_name VARCHAR, cust_id VARCHAR) <answer>: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER B...
1,797
<question>: Find the state which has the most number of customers. <context>: CREATE TABLE bank (state VARCHAR, no_of_customers INTEGER) <answer>: SELECT state FROM bank GROUP BY state ORDER BY SUM(no_of_customers) DESC LIMIT 1
1,798
<question>: For each account type, find the average account balance of customers with credit score lower than 50. <context>: CREATE TABLE customer (acc_type VARCHAR, acc_bal INTEGER, credit_score INTEGER) <answer>: SELECT AVG(acc_bal), acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type
1,799
<question>: For each state, find the total account balance of customers whose credit score is above 100. <context>: CREATE TABLE customer (state VARCHAR, acc_bal INTEGER, credit_score INTEGER) <answer>: SELECT SUM(acc_bal), state FROM customer WHERE credit_score > 100 GROUP BY state