Question: Find the average number of customers in all banks of Utah state.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : no_of_customers (number) , state (text) , branch_id (number)


Question: What is the average number of customers across banks in the state of Utah?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : no_of_customers (number) , state (text) , branch_id (number)


Question: Find the average number of customers cross all banks.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : no_of_customers (number) , branch_id (number)


Question: What is the average number of bank customers?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : no_of_customers (number) , branch_id (number)


Question: Find the city and state of the bank branch named morningside.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : city (text) , state (text) , bname (text) , branch_id (number)


Question: What city and state is the bank with the name morningside in?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : city (text) , state (text) , bname (text) , branch_id (number)


Question: Find the branch names of banks in the New York state.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , state (text) , branch_id (number)


Question: What are the names of banks in the state of New York?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , state (text) , branch_id (number)


Question: List the name of all customers sorted by their account balance in ascending order.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_bal (number) , cust_id (text)


Question: What are the names of all customers, ordered by account balance?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_bal (number) , cust_id (text)


Question: List the name of all different customers who have some loan sorted by their total loan amount.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , amount (number) , loan_id (text)


Question: What are the names of the different customers who have taken out a loan, ordered by the total amount that they have taken?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , amount (number) , loan_id (text)


Question: Find the state, account type, and credit score of the customer whose number of loan is 0.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : state (text) , acc_type (text) , credit_score (number) , no_of_loans (number) , cust_id (text)


Question: What are the states, account types, and credit scores for customers who have 0 loans?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : state (text) , acc_type (text) , credit_score (number) , no_of_loans (number) , cust_id (text)


Question: Find the number of different cities which banks are located at.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)


Question: In how many different cities are banks located?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)


Question: Find the number of different states which banks are located at.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : state (text) , branch_id (number)


Question: In how many different states are banks located?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : state (text) , branch_id (number)


Question: How many distinct types of accounts are there?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : acc_type (text) , cust_id (text)


Question: Count the number of different account types.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : acc_type (text) , cust_id (text)


Question: Find the name and account balance of the customer whose name includes the letter ‘a’.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_bal (number) , cust_id (text)


Question: What are the names and account balances of customers with the letter a in their names?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_bal (number) , cust_id (text)


Question: Find the total account balance of each customer from Utah or Texas.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : acc_bal (number) , state (text) , cust_id (text)


Question: What are the total account balances for each customer from Utah or Texas?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : acc_bal (number) , state (text) , cust_id (text)


Question: Find the name of customers who have both saving and checking account types.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_type (text) , cust_id (text)


Question: What are the names of customers who have both savings and checking accounts?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_type (text) , cust_id (text)


Question: Find the name of customers who do not have an saving account.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_type (text) , cust_id (text)


Question: What are the names of customers who do not have saving accounts?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_type (text) , cust_id (text)


Question: Find the name of customers who do not have a loan with a type of Mortgages.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , loan_type (text) , loan_id (text)


Question: What are the names of customers who have not taken a Mortage loan?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , loan_type (text) , loan_id (text)


Question: Find the name of customers who have loans of both Mortgages and Auto.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , loan_type (text) , loan_id (text)


Question: What are the names of customers who have taken both Mortgage and Auto loans?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , loan_type (text) , loan_id (text)


Question: Find the name of customers whose credit score is below the average credit scores of all customers.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , credit_score (number) , cust_id (text)


Question: What are the names of customers with credit score less than the average credit score across customers?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , credit_score (number) , cust_id (text)


Question: Find the branch name of the bank that has the most number of customers.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , no_of_customers (number) , branch_id (number)


Question: What is the name of the bank branch with the greatest number of customers?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , no_of_customers (number) , branch_id (number)


Question: Find the name of customer who has the lowest credit score.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , credit_score (number) , cust_id (text)


Question: What is the name of the customer with the worst credit score?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , credit_score (number) , cust_id (text)


Question: Find the name, account type, and account balance of the customer who has the highest credit score.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_type (text) , acc_bal (number) , credit_score (number) , cust_id (text)


Question: What is the name, account type, and account balance corresponding to the customer with the highest credit score?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_type (text) , acc_bal (number) , credit_score (number) , cust_id (text)


Question: Find the name of customer who has the highest amount of loans.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , amount (number) , loan_id (text)


Question: What is the name of the customer who has greatest total loan amount?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , amount (number) , loan_id (text)


Question: Find the state which has the most number of customers.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : state (text) , no_of_customers (number) , branch_id (number)


Question: Which state has the greatest total number of bank customers?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : state (text) , no_of_customers (number) , branch_id (number)


Question: For each account type, find the average account balance of customers with credit score lower than 50.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : acc_bal (number) , acc_type (text) , credit_score (number) , cust_id (text)


Question: What is the average account balance of customers with credit score below 50 for the different account types?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : acc_bal (number) , acc_type (text) , credit_score (number) , cust_id (text)


Question: For each state, find the total account balance of customers whose credit score is above 100.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : acc_bal (number) , state (text) , credit_score (number) , cust_id (text)


Question: What is the total account balance for customers with a credit score of above 100 for the different states?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : acc_bal (number) , state (text) , credit_score (number) , cust_id (text)


Question: Find the total amount of loans offered by each bank branch.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

loan : amount (number) , branch_id (text) , loan_id (text) | bank : bname (text) , branch_id (number)


Question: What are the names of the different bank branches, and what are their total loan amounts?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

loan : amount (number) , branch_id (text) , loan_id (text) | bank : bname (text) , branch_id (number)


Question: Find the name of customers who have more than one loan.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , loan_id (text)


Question: What are the names of customers who have taken out more than one loan?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , loan_id (text)


Question: Find the name and account balance of the customers who have loans with a total amount of more than 5000.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_type (text) , cust_id (text) | loan : cust_id (text) , amount (number) , loan_id (text)


Question: What are the names and account balances for customers who have taken a total amount of more than 5000 in loans?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , acc_type (text) , cust_id (text) | loan : cust_id (text) , amount (number) , loan_id (text)


Question: Find the name of bank branch that provided the greatest total amount of loans.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , branch_id (number) | loan : branch_id (text) , amount (number) , loan_id (text)


Question: What is the name of the bank branch that has lent the greatest amount?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , branch_id (number) | loan : branch_id (text) , amount (number) , loan_id (text)


Question: Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , branch_id (number) | customer : branch_id (number) , cust_id (text) , credit_score (number) | loan : branch_id (text) , cust_id (text) , amount (number) , loan_id (text)


Question: 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?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , branch_id (number) | customer : branch_id (number) , cust_id (text) , credit_score (number) | loan : branch_id (text) , cust_id (text) , amount (number) , loan_id (text)


Question: Find the name of bank branches that provided some loans.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , branch_id (number) | loan : branch_id (text) , loan_id (text)


Question: What are the names of the different banks that have provided loans?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , branch_id (number) | loan : branch_id (text) , loan_id (text)


Question: Find the name and credit score of the customers who have some loans.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , credit_score (number) , cust_id (text) | loan : cust_id (text) , loan_id (text)


Question: What are the different names and credit scores of customers who have taken a loan?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , credit_score (number) , cust_id (text) | loan : cust_id (text) , loan_id (text)


Question: Find the the name of the customers who have a loan with amount more than 3000.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , amount (number) , loan_id (text)


Question: What are the names of customers who have a loan of more than 3000 in amount?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : cust_name (text) , cust_id (text) | loan : cust_id (text) , amount (number) , loan_id (text)


Question: Find the city and name of bank branches that provide business loans.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , city (text) , branch_id (number) | loan : branch_id (text) , loan_type (text) , loan_id (text)


Question: What are the names and cities of bank branches that offer loans for business?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , city (text) , branch_id (number) | loan : branch_id (text) , loan_type (text) , loan_id (text)


Question: Find the names of bank branches that have provided a loan to any customer whose credit score is below 100.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , branch_id (number) | customer : branch_id (number) , cust_id (text) , credit_score (number) | loan : branch_id (text) , cust_id (text) , loan_id (text)


Question: What are the names of banks that have loaned money to customers with credit scores below 100?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

bank : bname (text) , branch_id (number) | customer : branch_id (number) , cust_id (text) , credit_score (number) | loan : branch_id (text) , cust_id (text) , loan_id (text)


Question: Find the total amount of loans provided by bank branches in the state of New York.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

loan : amount (number) , branch_id (text) , loan_id (text) | bank : branch_id (number) , state (text)


Question: What is the total amount of money loaned by banks in New York state?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

loan : amount (number) , branch_id (text) , loan_id (text) | bank : branch_id (number) , state (text)


Question: Find the average credit score of the customers who have some loan.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : credit_score (number) , cust_id (text) | loan : cust_id (text) , loan_id (text)


Question: What is the average credit score for customers who have taken a loan?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : credit_score (number) , cust_id (text) | loan : cust_id (text) , loan_id (text)


Question: Find the average credit score of the customers who do not have any loan.

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : credit_score (number) , cust_id (text) | loan : cust_id (text) , loan_id (text)


Question: What is the average credit score for customers who have never taken a loan?

bank : branch_id (number) , bname (text) , no_of_customers (number) , city (text) , state (text) | customer : cust_id (text) , cust_name (text) , acc_type (text) , acc_bal (number) , no_of_loans (number) , credit_score (number) , branch_id (number) , state (text) | loan : loan_id (text) , loan_type (text) , cust_id (text) , branch_id (text) , amount (number)

customer : credit_score (number) , cust_id (text) | loan : cust_id (text) , loan_id (text)


Question: What are the dates of the assessment notes?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)


Question: How many addresses have zip code 197?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

addresses : zip_postcode (text) , address_id (number)


Question: How many distinct incident type codes are there?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

behavior_incident : incident_type_code (text) , incident_id (number)


Question: Return all distinct detention type codes.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

detention : detention_type_code (text) , detention_id (number)


Question: What are the start and end dates for incidents with incident type code "NOISE"?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

behavior_incident : date_incident_start (time) , date_incident_end (time) , incident_type_code (text) , incident_id (number)


Question: Return all detention summaries.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

detention : detention_summary (text) , detention_id (number)


Question: Return the cell phone number and email address for all students.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

students : cell_mobile_number (text) , email_address (text) , student_id (number)


Question: What is the email of the student with first name "Emma" and last name "Rohan"?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

students : email_address (text) , first_name (text) , last_name (text) , student_id (number)


Question: How many distinct students have been in detention?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)


Question: What is the gender of the teacher with last name "Medhurst"?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

teachers : gender (text) , last_name (text) , teacher_id (number)


Question: What is the incident type description for the incident type with code "VIOLENCE"?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

ref_incident_type : incident_type_description (text) , incident_type_code (text)


Question: Find the maximum and minimum monthly rental for all student addresses.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

student_addresses : monthly_rental (number)


Question: Find the first names of teachers whose email address contains the word "man".

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

teachers : first_name (text) , email_address (text) , teacher_id (number)


Question: List all information about the assessment notes sorted by date in ascending order.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)


Question: List all cities of addresses in alphabetical order.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

addresses : city (text) , address_id (number)


Question: Find the first names and last names of teachers in alphabetical order of last name.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

teachers : first_name (text) , last_name (text) , teacher_id (number)


Question: Find all information about student addresses, and sort by monthly rental in descending order.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

student_addresses : monthly_rental (number)


Question: Find the id and first name of the student that has the most number of assessment notes?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

students : student_id (number) , first_name (text) | assessment_notes : student_id (number)


Question: Find the ids and first names of the 3 teachers that have the most number of assessment notes?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

teachers : teacher_id (number) , first_name (text) | assessment_notes : teacher_id (number)


Question: Find the id and last name of the student that has the most behavior incidents?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

students : student_id (number) , last_name (text) | behavior_incident : student_id (number) , incident_id (number)


Question: Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

teachers : teacher_id (number) , last_name (text) | detention : teacher_id (number) , detention_type_code (text) , detention_id (number)


Question: What are the id and first name of the student whose addresses have the highest average monthly rental?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

students : student_id (number) , first_name (text) | student_addresses : student_id (number) , monthly_rental (number)


Question: Find the id and city of the student address with the highest average monthly rental.

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

addresses : address_id (number) , city (text) | student_addresses : address_id (number) , monthly_rental (number)


Question: What are the code and description of the most frequent behavior incident type?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

ref_incident_type : incident_type_code (text) , incident_type_description (text) | behavior_incident : incident_type_code (text) , incident_id (number)


Question: What are the code and description of the least frequent detention type ?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

ref_detention_type : detention_type_code (text) , detention_type_description (text) | detention : detention_type_code (text) , detention_id (number)


Question: Find the dates of assessment notes for students with first name "Fanny".

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

assessment_notes : date_of_notes (time) , student_id (number) | students : student_id (number) , first_name (text)


Question: Find the texts of assessment notes for teachers with last name "Schuster".

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

assessment_notes : text_of_notes (text) , teacher_id (number) | teachers : teacher_id (number) , last_name (text)


Question: Find the start and end dates of behavior incidents of students with last name "Fahey".

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

behavior_incident : date_incident_start (time) , date_incident_end (time) , student_id (number) , incident_id (number) | students : student_id (number) , last_name (text)


Question: Find the start and end dates of detentions of teachers with last name "Schultz".

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

detention : datetime_detention_start (time) , datetime_detention_end (time) , teacher_id (number) , detention_id (number) | teachers : teacher_id (number) , last_name (text)


Question: What are the id and zip code of the address with the highest monthly rental?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

addresses : address_id (number) , zip_postcode (text) | student_addresses : address_id (number) , monthly_rental (number)


Question: What is the cell phone number of the student whose address has the lowest monthly rental?

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 (number) , line_1 (text) , line_2 (text) , line_3 (text) , city (text) , zip_postcode (text) , state_province_county (text) , country (text) , other_address_details (text) | students : student_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , cell_mobile_number (text) , email_address (text) , date_first_rental (time) , date_left_university (time) , other_student_details (text) | teachers : teacher_id (number) , address_id (number) , first_name (text) , middle_name (text) , last_name (text) , gender (text) , cell_mobile_number (text) , email_address (text) , other_details (text) | assessment_notes : notes_id (number) , student_id (number) , teacher_id (number) , date_of_notes (time) , text_of_notes (text) , other_details (text) | behavior_incident : incident_id (number) , incident_type_code (text) , student_id (number) , date_incident_start (time) , date_incident_end (time) , incident_summary (text) , recommendations (text) , other_details (text) | detention : detention_id (number) , detention_type_code (text) , teacher_id (number) , datetime_detention_start (time) , datetime_detention_end (time) , detention_summary (text) , other_details (text) | student_addresses : student_id (number) , address_id (number) , date_address_from (time) , date_address_to (time) , monthly_rental (number) , other_details (text) | students_in_detention : student_id (number) , detention_id (number) , incident_id (number)

students : cell_mobile_number (text) , student_id (number) | student_addresses : student_id (number) , monthly_rental (number)