db_id
stringlengths 3
31
| query
stringlengths 18
577
| question
stringlengths 3
224
| schema
stringlengths 177
6.14k
| primary_keys
stringlengths 16
545
| foreign_keys
stringlengths 16
1.48k
|
---|---|---|---|---|---|
sakila_1 | SELECT amount FROM payment ORDER BY amount DESC LIMIT 1 | What is the largest payment amount? | [Schema (values) (types)]: | sakila_1 | actor : actor_id (text) , first_name (number) , last_name (text) , last_update (text) | address : address_id (text) , address (number) , address2 (text) , district (text) , city_id (time) , postal_code (number) , phone (text) , last_update (text) | category : category_id (text) , name (number) , last_update (text) | city : city_id (text) , city (number) , country_id (text) , last_update (text) | country : country_id (text) , country (number) , last_update (text) | customer : customer_id (text) , store_id (number) , first_name (text) , last_name (text) , email (time) , address_id (number) , active (text) , create_date (text) , last_update (text) | film : film_id (text) , title (number) , description (text) , release_year (text) , language_id (time) , original_language_id (number) , rental_duration (text) , rental_rate (text) , length (text) , replacement_cost (number) , rating (text) , special_features (text) , last_update (time) | film_actor : actor_id (text) , film_id (number) , last_update (text) | film_category : film_id (text) , category_id (number) , last_update (text) | film_text : film_id (text) , title (number) , description (text) | inventory : inventory_id (text) , film_id (number) , store_id (text) , last_update (text) | language : language_id (text) , name (number) , last_update (text) | payment : payment_id (text) , customer_id (number) , staff_id (text) , rental_id (text) , amount (time) , payment_date (number) , last_update (text) | rental : rental_id (text) , rental_date (number) , inventory_id (text) , customer_id (text) , return_date (time) , staff_id (number) , last_update (text) | staff : staff_id (text) , first_name (number) , last_name (text) , address_id (text) , picture (time) , email (number) , store_id (text) , active (text) , username (text) , password (number) , last_update (text) | store : store_id (text) , manager_staff_id (number) , address_id (text) , last_update (text); | [Primary Keys]: actor : actor_id, address : address_id, category : category_id, city : city_id, country : country_id, customer : customer_id, film : film_id, film_actor : actor_id, film_category : film_id, film_text : film_id, inventory : inventory_id, language : language_id, payment : payment_id, rental : rental_id, staff : staff_id, store : store_id | [Foreign Keys]: address : city_id = city : city_id | city : country_id = country : country_id | customer : store_id = store : store_id | customer : address_id = address : address_id | film : original_language_id = language : language_id | film : language_id = language : language_id | film_actor : film_id = film : film_id | film_actor : actor_id = actor : actor_id | film_category : category_id = category : category_id | film_category : film_id = film : film_id | inventory : film_id = film : film_id | inventory : store_id = store : store_id | payment : staff_id = staff : staff_id | payment : customer_id = customer : customer_id | payment : rental_id = rental : rental_id | rental : customer_id = customer : customer_id | rental : inventory_id = inventory : inventory_id | rental : staff_id = staff : staff_id | staff : address_id = address : address_id | store : address_id = address : address_id | store : manager_staff_id = staff : staff_id |
sakila_1 | SELECT amount FROM payment ORDER BY amount DESC LIMIT 1 | Return the amount of the largest payment. | [Schema (values) (types)]: | sakila_1 | actor : actor_id (text) , first_name (number) , last_name (text) , last_update (text) | address : address_id (text) , address (number) , address2 (text) , district (text) , city_id (time) , postal_code (number) , phone (text) , last_update (text) | category : category_id (text) , name (number) , last_update (text) | city : city_id (text) , city (number) , country_id (text) , last_update (text) | country : country_id (text) , country (number) , last_update (text) | customer : customer_id (text) , store_id (number) , first_name (text) , last_name (text) , email (time) , address_id (number) , active (text) , create_date (text) , last_update (text) | film : film_id (text) , title (number) , description (text) , release_year (text) , language_id (time) , original_language_id (number) , rental_duration (text) , rental_rate (text) , length (text) , replacement_cost (number) , rating (text) , special_features (text) , last_update (time) | film_actor : actor_id (text) , film_id (number) , last_update (text) | film_category : film_id (text) , category_id (number) , last_update (text) | film_text : film_id (text) , title (number) , description (text) | inventory : inventory_id (text) , film_id (number) , store_id (text) , last_update (text) | language : language_id (text) , name (number) , last_update (text) | payment : payment_id (text) , customer_id (number) , staff_id (text) , rental_id (text) , amount (time) , payment_date (number) , last_update (text) | rental : rental_id (text) , rental_date (number) , inventory_id (text) , customer_id (text) , return_date (time) , staff_id (number) , last_update (text) | staff : staff_id (text) , first_name (number) , last_name (text) , address_id (text) , picture (time) , email (number) , store_id (text) , active (text) , username (text) , password (number) , last_update (text) | store : store_id (text) , manager_staff_id (number) , address_id (text) , last_update (text); | [Primary Keys]: actor : actor_id, address : address_id, category : category_id, city : city_id, country : country_id, customer : customer_id, film : film_id, film_actor : actor_id, film_category : film_id, film_text : film_id, inventory : inventory_id, language : language_id, payment : payment_id, rental : rental_id, staff : staff_id, store : store_id | [Foreign Keys]: address : city_id = city : city_id | city : country_id = country : country_id | customer : store_id = store : store_id | customer : address_id = address : address_id | film : original_language_id = language : language_id | film : language_id = language : language_id | film_actor : film_id = film : film_id | film_actor : actor_id = actor : actor_id | film_category : category_id = category : category_id | film_category : film_id = film : film_id | inventory : film_id = film : film_id | inventory : store_id = store : store_id | payment : staff_id = staff : staff_id | payment : customer_id = customer : customer_id | payment : rental_id = rental : rental_id | rental : customer_id = customer : customer_id | rental : inventory_id = inventory : inventory_id | rental : staff_id = staff : staff_id | staff : address_id = address : address_id | store : address_id = address : address_id | store : manager_staff_id = staff : staff_id |
sakila_1 | SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa' | Where does the staff member with the first name Elsa live? | [Schema (values) (types)]: | sakila_1 | actor : actor_id (text) , first_name (number) , last_name (text) , last_update (text) | address : address_id (text) , address (number) , address2 (text) , district (text) , city_id (time) , postal_code (number) , phone (text) , last_update (text) | category : category_id (text) , name (number) , last_update (text) | city : city_id (text) , city (number) , country_id (text) , last_update (text) | country : country_id (text) , country (number) , last_update (text) | customer : customer_id (text) , store_id (number) , first_name (text) , last_name (text) , email (time) , address_id (number) , active (text) , create_date (text) , last_update (text) | film : film_id (text) , title (number) , description (text) , release_year (text) , language_id (time) , original_language_id (number) , rental_duration (text) , rental_rate (text) , length (text) , replacement_cost (number) , rating (text) , special_features (text) , last_update (time) | film_actor : actor_id (text) , film_id (number) , last_update (text) | film_category : film_id (text) , category_id (number) , last_update (text) | film_text : film_id (text) , title (number) , description (text) | inventory : inventory_id (text) , film_id (number) , store_id (text) , last_update (text) | language : language_id (text) , name (number) , last_update (text) | payment : payment_id (text) , customer_id (number) , staff_id (text) , rental_id (text) , amount (time) , payment_date (number) , last_update (text) | rental : rental_id (text) , rental_date (number) , inventory_id (text) , customer_id (text) , return_date (time) , staff_id (number) , last_update (text) | staff : staff_id (text) , first_name (number) , last_name (text) , address_id (text) , picture (time) , email (number) , store_id (text) , active (text) , username (text) , password (number) , last_update (text) | store : store_id (text) , manager_staff_id (number) , address_id (text) , last_update (text); | [Primary Keys]: actor : actor_id, address : address_id, category : category_id, city : city_id, country : country_id, customer : customer_id, film : film_id, film_actor : actor_id, film_category : film_id, film_text : film_id, inventory : inventory_id, language : language_id, payment : payment_id, rental : rental_id, staff : staff_id, store : store_id | [Foreign Keys]: address : city_id = city : city_id | city : country_id = country : country_id | customer : store_id = store : store_id | customer : address_id = address : address_id | film : original_language_id = language : language_id | film : language_id = language : language_id | film_actor : film_id = film : film_id | film_actor : actor_id = actor : actor_id | film_category : category_id = category : category_id | film_category : film_id = film : film_id | inventory : film_id = film : film_id | inventory : store_id = store : store_id | payment : staff_id = staff : staff_id | payment : customer_id = customer : customer_id | payment : rental_id = rental : rental_id | rental : customer_id = customer : customer_id | rental : inventory_id = inventory : inventory_id | rental : staff_id = staff : staff_id | staff : address_id = address : address_id | store : address_id = address : address_id | store : manager_staff_id = staff : staff_id |
sakila_1 | SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.first_name = 'Elsa' | Give the address of the staff member who has the first name Elsa. | [Schema (values) (types)]: | sakila_1 | actor : actor_id (text) , first_name (number) , last_name (text) , last_update (text) | address : address_id (text) , address (number) , address2 (text) , district (text) , city_id (time) , postal_code (number) , phone (text) , last_update (text) | category : category_id (text) , name (number) , last_update (text) | city : city_id (text) , city (number) , country_id (text) , last_update (text) | country : country_id (text) , country (number) , last_update (text) | customer : customer_id (text) , store_id (number) , first_name (text) , last_name (text) , email (time) , address_id (number) , active (text) , create_date (text) , last_update (text) | film : film_id (text) , title (number) , description (text) , release_year (text) , language_id (time) , original_language_id (number) , rental_duration (text) , rental_rate (text) , length (text) , replacement_cost (number) , rating (text) , special_features (text) , last_update (time) | film_actor : actor_id (text) , film_id (number) , last_update (text) | film_category : film_id (text) , category_id (number) , last_update (text) | film_text : film_id (text) , title (number) , description (text) | inventory : inventory_id (text) , film_id (number) , store_id (text) , last_update (text) | language : language_id (text) , name (number) , last_update (text) | payment : payment_id (text) , customer_id (number) , staff_id (text) , rental_id (text) , amount (time) , payment_date (number) , last_update (text) | rental : rental_id (text) , rental_date (number) , inventory_id (text) , customer_id (text) , return_date (time) , staff_id (number) , last_update (text) | staff : staff_id (text) , first_name (number) , last_name (text) , address_id (text) , picture (time) , email (number) , store_id (text) , active (text) , username (text) , password (number) , last_update (text) | store : store_id (text) , manager_staff_id (number) , address_id (text) , last_update (text); | [Primary Keys]: actor : actor_id, address : address_id, category : category_id, city : city_id, country : country_id, customer : customer_id, film : film_id, film_actor : actor_id, film_category : film_id, film_text : film_id, inventory : inventory_id, language : language_id, payment : payment_id, rental : rental_id, staff : staff_id, store : store_id | [Foreign Keys]: address : city_id = city : city_id | city : country_id = country : country_id | customer : store_id = store : store_id | customer : address_id = address : address_id | film : original_language_id = language : language_id | film : language_id = language : language_id | film_actor : film_id = film : film_id | film_actor : actor_id = actor : actor_id | film_category : category_id = category : category_id | film_category : film_id = film : film_id | inventory : film_id = film : film_id | inventory : store_id = store : store_id | payment : staff_id = staff : staff_id | payment : customer_id = customer : customer_id | payment : rental_id = rental : rental_id | rental : customer_id = customer : customer_id | rental : inventory_id = inventory : inventory_id | rental : staff_id = staff : staff_id | staff : address_id = address : address_id | store : address_id = address : address_id | store : manager_staff_id = staff : staff_id |
sakila_1 | SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01' ) | What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'? | [Schema (values) (types)]: | sakila_1 | actor : actor_id (text) , first_name (number) , last_name (text) , last_update (text) | address : address_id (text) , address (number) , address2 (text) , district (text) , city_id (time) , postal_code (number) , phone (text) , last_update (text) | category : category_id (text) , name (number) , last_update (text) | city : city_id (text) , city (number) , country_id (text) , last_update (text) | country : country_id (text) , country (number) , last_update (text) | customer : customer_id (text) , store_id (number) , first_name (text) , last_name (text) , email (time) , address_id (number) , active (text) , create_date (text) , last_update (text) | film : film_id (text) , title (number) , description (text) , release_year (text) , language_id (time) , original_language_id (number) , rental_duration (text) , rental_rate (text) , length (text) , replacement_cost (number) , rating (text) , special_features (text) , last_update (time) | film_actor : actor_id (text) , film_id (number) , last_update (text) | film_category : film_id (text) , category_id (number) , last_update (text) | film_text : film_id (text) , title (number) , description (text) | inventory : inventory_id (text) , film_id (number) , store_id (text) , last_update (text) | language : language_id (text) , name (number) , last_update (text) | payment : payment_id (text) , customer_id (number) , staff_id (text) , rental_id (text) , amount (time) , payment_date (number) , last_update (text) | rental : rental_id (text) , rental_date (number) , inventory_id (text) , customer_id (text) , return_date (time) , staff_id (number) , last_update (text) | staff : staff_id (text) , first_name (number) , last_name (text) , address_id (text) , picture (time) , email (number) , store_id (text) , active (text) , username (text) , password (number) , last_update (text) | store : store_id (text) , manager_staff_id (number) , address_id (text) , last_update (text); | [Primary Keys]: actor : actor_id, address : address_id, category : category_id, city : city_id, country : country_id, customer : customer_id, film : film_id, film_actor : actor_id, film_category : film_id, film_text : film_id, inventory : inventory_id, language : language_id, payment : payment_id, rental : rental_id, staff : staff_id, store : store_id | [Foreign Keys]: address : city_id = city : city_id | city : country_id = country : country_id | customer : store_id = store : store_id | customer : address_id = address : address_id | film : original_language_id = language : language_id | film : language_id = language : language_id | film_actor : film_id = film : film_id | film_actor : actor_id = actor : actor_id | film_category : category_id = category : category_id | film_category : film_id = film : film_id | inventory : film_id = film : film_id | inventory : store_id = store : store_id | payment : staff_id = staff : staff_id | payment : customer_id = customer : customer_id | payment : rental_id = rental : rental_id | rental : customer_id = customer : customer_id | rental : inventory_id = inventory : inventory_id | rental : staff_id = staff : staff_id | staff : address_id = address : address_id | store : address_id = address : address_id | store : manager_staff_id = staff : staff_id |
sakila_1 | SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date > '2005-08-23 02:06:01' ) | Return the first names of customers who did not rented a film after the date '2005-08-23 02:06:01'. | [Schema (values) (types)]: | sakila_1 | actor : actor_id (text) , first_name (number) , last_name (text) , last_update (text) | address : address_id (text) , address (number) , address2 (text) , district (text) , city_id (time) , postal_code (number) , phone (text) , last_update (text) | category : category_id (text) , name (number) , last_update (text) | city : city_id (text) , city (number) , country_id (text) , last_update (text) | country : country_id (text) , country (number) , last_update (text) | customer : customer_id (text) , store_id (number) , first_name (text) , last_name (text) , email (time) , address_id (number) , active (text) , create_date (text) , last_update (text) | film : film_id (text) , title (number) , description (text) , release_year (text) , language_id (time) , original_language_id (number) , rental_duration (text) , rental_rate (text) , length (text) , replacement_cost (number) , rating (text) , special_features (text) , last_update (time) | film_actor : actor_id (text) , film_id (number) , last_update (text) | film_category : film_id (text) , category_id (number) , last_update (text) | film_text : film_id (text) , title (number) , description (text) | inventory : inventory_id (text) , film_id (number) , store_id (text) , last_update (text) | language : language_id (text) , name (number) , last_update (text) | payment : payment_id (text) , customer_id (number) , staff_id (text) , rental_id (text) , amount (time) , payment_date (number) , last_update (text) | rental : rental_id (text) , rental_date (number) , inventory_id (text) , customer_id (text) , return_date (time) , staff_id (number) , last_update (text) | staff : staff_id (text) , first_name (number) , last_name (text) , address_id (text) , picture (time) , email (number) , store_id (text) , active (text) , username (text) , password (number) , last_update (text) | store : store_id (text) , manager_staff_id (number) , address_id (text) , last_update (text); | [Primary Keys]: actor : actor_id, address : address_id, category : category_id, city : city_id, country : country_id, customer : customer_id, film : film_id, film_actor : actor_id, film_category : film_id, film_text : film_id, inventory : inventory_id, language : language_id, payment : payment_id, rental : rental_id, staff : staff_id, store : store_id | [Foreign Keys]: address : city_id = city : city_id | city : country_id = country : country_id | customer : store_id = store : store_id | customer : address_id = address : address_id | film : original_language_id = language : language_id | film : language_id = language : language_id | film_actor : film_id = film : film_id | film_actor : actor_id = actor : actor_id | film_category : category_id = category : category_id | film_category : film_id = film : film_id | inventory : film_id = film : film_id | inventory : store_id = store : store_id | payment : staff_id = staff : staff_id | payment : customer_id = customer : customer_id | payment : rental_id = rental : rental_id | rental : customer_id = customer : customer_id | rental : inventory_id = inventory : inventory_id | rental : staff_id = staff : staff_id | staff : address_id = address : address_id | store : address_id = address : address_id | store : manager_staff_id = staff : staff_id |
loan_1 | SELECT count(*) FROM bank | How many bank branches are there? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT count(*) FROM bank | Count the number of bank branches. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(no_of_customers) FROM bank | How many customers are there? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(no_of_customers) FROM bank | What is the total number of customers across banks? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(no_of_customers) FROM bank WHERE city = 'New York City' | Find the number of customers in the banks at New York City. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(no_of_customers) FROM bank WHERE city = 'New York City' | What is the total number of customers who use banks in New York City? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(no_of_customers) FROM bank WHERE state = 'Utah' | Find the average number of customers in all banks of Utah state. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(no_of_customers) FROM bank WHERE state = 'Utah' | What is the average number of customers across banks in the state of Utah? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(no_of_customers) FROM bank | Find the average number of customers cross all banks. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(no_of_customers) FROM bank | What is the average number of bank customers? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT city , state FROM bank WHERE bname = 'morningside' | Find the city and state of the bank branch named morningside. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT city , state FROM bank WHERE bname = 'morningside' | What city and state is the bank with the name morningside in? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT bname FROM bank WHERE state = 'New York' | Find the branch names of banks in the New York state. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT bname FROM bank WHERE state = 'New York' | What are the names of banks in the state of New York? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer ORDER BY acc_bal | List the name of all customers sorted by their account balance in ascending order. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer ORDER BY acc_bal | What are the names of all customers, ordered by account balance? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) | List the name of all different customers who have some loan sorted by their total loan amount. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) | What are the names of the different customers who have taken out a loan, ordered by the total amount that they have taken? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT state , acc_type , credit_score FROM customer WHERE no_of_loans = 0 | Find the state, account type, and credit score of the customer whose number of loan is 0. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT state , acc_type , credit_score FROM customer WHERE no_of_loans = 0 | What are the states, account types, and credit scores for customers who have 0 loans? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT count(DISTINCT city) FROM bank | Find the number of different cities which banks are located at. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT count(DISTINCT city) FROM bank | In how many different cities are banks located? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT count(DISTINCT state) FROM bank | Find the number of different states which banks are located at. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT count(DISTINCT state) FROM bank | In how many different states are banks located? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT count(DISTINCT acc_type) FROM customer | How many distinct types of accounts are there? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT count(DISTINCT acc_type) FROM customer | Count the number of different account types. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%' | Find the name and account balance of the customer whose name includes the letter ‘a’. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%' | What are the names and account balances of customers with the letter a in their names? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' | Find the total account balance of each customer from Utah or Texas. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' | What are the total account balances for each customer from Utah or Texas? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking' | Find the name of customers who have both saving and checking account types. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking' | What are the names of customers who have both savings and checking accounts? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' | Find the name of customers who do not have an saving account. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' | What are the names of customers who do not have saving accounts? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages' | Find the name of customers who do not have a loan with a type of Mortgages. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE T2.loan_type = 'Mortgages' | What are the names of customers who have not taken a Mortage loan? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto' | Find the name of customers who have loans of both Mortgages and Auto. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE loan_type = 'Auto' | What are the names of customers who have taken both Mortgage and Auto loans? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer) | Find the name of customers whose credit score is below the average credit scores of all customers. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer) | What are the names of customers with credit score less than the average credit score across customers? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1 | Find the branch name of the bank that has the most number of customers. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1 | What is the name of the bank branch with the greatest number of customers? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 | Find the name of customer who has the lowest credit score. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 | What is the name of the customer with the worst credit score? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1 | Find the name, account type, and account balance of the customer who has the highest credit score. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1 | What is the name, account type, and account balance corresponding to the customer with the highest credit score? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1 | Find the name of customer who has the highest amount of loans. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1 | What is the name of the customer who has greatest total loan amount? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1 | Find the state which has the most number of customers. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1 | Which state has the greatest total number of bank customers? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type | For each account type, find the average account balance of customers with credit score lower than 50. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type | What is the average account balance of customers with credit score below 50 for the different account types? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state | For each state, find the total account balance of customers whose credit score is above 100. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state | What is the total account balance for customers with a credit score of above 100 for the different states? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname | Find the total amount of loans offered by each bank branch. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname | What are the names of the different bank branches, and what are their total loan amounts? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING count(*) > 1 | Find the name of customers who have more than one loan. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING count(*) > 1 | What are the names of customers who have taken out more than one loan? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name , T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount) > 5000 | Find the name and account balance of the customers who have loans with a total amount of more than 5000. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name , T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount) > 5000 | What are the names and account balances for customers who have taken a total amount of more than 5000 in loans? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1 | Find the name of bank branch that provided the greatest total amount of loans. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1 | What is the name of the bank branch that has lent the greatest amount? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1 | Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1 | What is the name of the bank branch that has lended the largest total amount in loans, specifically to customers with credit scores below 100? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id | Find the name of bank branches that provided some loans. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id | What are the names of the different banks that have provided loans? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id | Find the name and credit score of the customers who have some loans. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id | What are the different names and credit scores of customers who have taken a loan? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000 | Find the the name of the customers who have a loan with amount more than 3000. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000 | What are the names of customers who have a loan of more than 3000 in amount? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.bname , T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business' | Find the city and name of bank branches that provide business loans. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T1.bname , T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T2.loan_type = 'Business' | What are the names and cities of bank branches that offer loans for business? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 | Find the names of bank branches that have provided a loan to any customer whose credit score is below 100. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id = T2.branch_id JOIN customer AS T3 ON T1.cust_id = T3.cust_id WHERE T3.credit_score < 100 | What are the names of banks that have loaned money to customers with credit scores below 100? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York' | Find the total amount of loans provided by bank branches in the state of New York. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York' | What is the total amount of money loaned by banks in New York state? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan) | Find the average credit score of the customers who have some loan. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan) | What is the average credit score for customers who have taken a loan? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan) | Find the average credit score of the customers who do not have any loan. | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
loan_1 | SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan) | What is the average credit score for customers who have never taken a loan? | [Schema (values) (types)]: | loan_1 | bank : branch_id (text) , bname (number) , no_of_customers (text) , city (number) , state (text) | customer : cust_id (text) , cust_name (number) , acc_type (text) , acc_bal (number) , no_of_loans (text) , credit_score (text) , branch_id (text) , state (text) | loan : loan_id (text) , loan_type (number) , cust_id (text) , branch_id (number) , amount (text); | [Primary Keys]: bank : branch_id, customer : cust_id, loan : loan_id | [Foreign Keys]: customer : branch_id = bank : branch_id | loan : branch_id = bank : branch_id |
behavior_monitoring | SELECT count(*) FROM ASSESSMENT_NOTES | How many assessment notes are there in total? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT date_of_notes FROM Assessment_Notes | What are the dates of the assessment notes? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT count(*) FROM ADDRESSES WHERE zip_postcode = "197" | How many addresses have zip code 197? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT count(DISTINCT incident_type_code) FROM Behavior_Incident | How many distinct incident type codes are there? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT DISTINCT detention_type_code FROM Detention | Return all distinct detention type codes. | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT date_incident_start , date_incident_end FROM Behavior_Incident WHERE incident_type_code = "NOISE" | What are the start and end dates for incidents with incident type code "NOISE"? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT detention_summary FROM Detention | Return all detention summaries. | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT cell_mobile_number , email_address FROM STUDENTS | Return the cell phone number and email address for all students. | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT email_address FROM Students WHERE first_name = "Emma" AND last_name = "Rohan" | What is the email of the student with first name "Emma" and last name "Rohan"? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT count(DISTINCT student_id) FROM Students_in_Detention | How many distinct students have been in detention? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT gender FROM TEACHERS WHERE last_name = "Medhurst" | What is the gender of the teacher with last name "Medhurst"? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code = "VIOLENCE" | What is the incident type description for the incident type with code "VIOLENCE"? | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT max(monthly_rental) , min(monthly_rental) FROM Student_Addresses | Find the maximum and minimum monthly rental for all student addresses. | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
behavior_monitoring | SELECT first_name FROM Teachers WHERE email_address LIKE '%man%' | Find the first names of teachers whose email address contains the word "man". | [Schema (values) (types)]: | behavior_monitoring | Ref_Address_Types : address_type_code (text) , address_type_description (text) | Ref_Detention_Type : detention_type_code (text) , detention_type_description (text) | Ref_Incident_Type : incident_type_code (text) , incident_type_description (text) | Addresses : address_id (text) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (number) , other_address_details (text) | Students : student_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (number) , date_left_university (text) , other_student_details (text) | Teachers : teacher_id (text) , address_id (text) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (number) , other_details (text) | Assessment_Notes : notes_id (text) , student_id (text) , teacher_id (text) , date_of_notes (text) , text_of_notes (text) , other_details (text) | Behavior_Incident : incident_id (text) , incident_type_code (text) , student_id (text) , date_incident_start (text) , date_incident_end (text) , incident_summary (text) , recommendations (text) , other_details (number) | Detention : detention_id (text) , detention_type_code (text) , teacher_id (text) , datetime_detention_start (text) , datetime_detention_end (text) , detention_summary (text) , other_details (text) | Student_Addresses : student_id (text) , address_id (text) , date_address_from (text) , date_address_to (text) , monthly_rental (text) , other_details (text) | Students_in_Detention : student_id (text) , detention_id (text) , incident_id (text); | [Primary Keys]: ref_address_types : address_type_code, ref_detention_type : detention_type_code, ref_incident_type : incident_type_code, addresses : address_id, students : student_id, teachers : teacher_id, assessment_notes : incident_id, behavior_incident : detention_id | [Foreign Keys]: students : address_id = addresses : address_id | teachers : address_id = addresses : address_id | assessment_notes : teacher_id = teachers : teacher_id | assessment_notes : student_id = students : student_id | behavior_incident : student_id = students : student_id | behavior_incident : incident_type_code = ref_incident_type : incident_type_code | detention : teacher_id = teachers : teacher_id | detention : detention_type_code = ref_detention_type : detention_type_code | student_addresses : student_id = students : student_id | student_addresses : address_id = addresses : address_id | students_in_detention : student_id = students : student_id | students_in_detention : detention_id = detention : detention_id | students_in_detention : incident_id = behavior_incident : incident_id |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.