minktn/spider-data huggingface dataset:
Database: sakila_1
Question: Return the address and email of the customer with the first name Linda.
SQL: SELECT T2.address ,  T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id  =  T1.address_id WHERE T1.first_name  =  'LINDA'
Database: sakila_1
Question: Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.
SQL: SELECT title FROM film WHERE LENGTH  >  100 OR rating  =  'PG' EXCEPT SELECT title FROM film WHERE replacement_cost  >  200
Database: sakila_1
Question: What are the titles of films that are either longer than 100 minutes or rated PG other than those that cost more than 200 to replace?
SQL: SELECT title FROM film WHERE LENGTH  >  100 OR rating  =  'PG' EXCEPT SELECT title FROM film WHERE replacement_cost  >  200
Database: sakila_1
Question: What is the first name and the last name of the customer who made the earliest rental?
SQL: SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
Database: sakila_1
Question: Return the full name of the customer who made the first rental.
SQL: SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
Database: sakila_1
Question: What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?
SQL: SELECT DISTINCT T1.first_name ,  T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id  =  T2.staff_id JOIN customer AS T3 ON T2.customer_id  =  T3.customer_id WHERE T3.first_name  =  'APRIL' AND T3.last_name  =  'BURNS'
Database: sakila_1
Question: Return the full name of the staff who provided a customer with the first name April and the last name Burns with a film rental.
SQL: SELECT DISTINCT T1.first_name ,  T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id  =  T2.staff_id JOIN customer AS T3 ON T2.customer_id  =  T3.customer_id WHERE T3.first_name  =  'APRIL' AND T3.last_name  =  'BURNS'
Database: sakila_1
Question: Which store has most the customers?
SQL: SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1
Database: sakila_1
Question: Return the id of the store with the most customers.
SQL: SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1
Database: sakila_1
Question: What is the largest payment amount?
SQL: SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
Database: sakila_1
Question: Return the amount of the largest payment.
SQL: SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
Database: sakila_1
Question: Where does the staff member with the first name Elsa live?
SQL: SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE T1.first_name  =  'Elsa'
Database: sakila_1
Question: Give the address of the staff member who has the first name Elsa.
SQL: SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE T1.first_name  =  'Elsa'
Database: sakila_1
Question: What are the first names of customers who have not rented any films after '2005-08-23 02:06:01'?
SQL: SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date  >  '2005-08-23 02:06:01' )
Database: sakila_1
Question: Return the first names of customers who did not rented a film after the date '2005-08-23 02:06:01'.
SQL: SELECT first_name FROM customer WHERE customer_id NOT IN( SELECT customer_id FROM rental WHERE rental_date  >  '2005-08-23 02:06:01' )
Database: loan_1
Question: How many bank branches are there?
SQL: SELECT count(*) FROM bank
Database: loan_1
Question: Count the number of bank branches.
SQL: SELECT count(*) FROM bank
Database: loan_1
Question: How many customers are there?
SQL: SELECT sum(no_of_customers) FROM bank
Database: loan_1
Question: What is the total number of customers across banks?
SQL: SELECT sum(no_of_customers) FROM bank
Database: loan_1
Question: Find the number of customers in the banks at New York City.
SQL: SELECT sum(no_of_customers) FROM bank WHERE city  =  'New York City'
Database: loan_1
Question: What is the total number of customers who use banks in New York City?
SQL: SELECT sum(no_of_customers) FROM bank WHERE city  =  'New York City'
Database: loan_1
Question: Find the average number of customers in all banks of Utah state.
SQL: SELECT avg(no_of_customers) FROM bank WHERE state  =  'Utah'
Database: loan_1
Question: What is the average number of customers across banks in the state of Utah?
SQL: SELECT avg(no_of_customers) FROM bank WHERE state  =  'Utah'
Database: loan_1
Question: Find the average number of customers cross all banks.
SQL: SELECT avg(no_of_customers) FROM bank
Database: loan_1
Question: What is the average number of bank customers?
SQL: SELECT avg(no_of_customers) FROM bank
Database: loan_1
Question: Find the city and state of the bank branch named morningside.
SQL: SELECT city ,  state FROM bank WHERE bname  =  'morningside'
Database: loan_1
Question: What city and state is the bank with the name morningside in?
SQL: SELECT city ,  state FROM bank WHERE bname  =  'morningside'
Database: loan_1
Question: Find the branch names of banks in the New York state.
SQL: SELECT bname FROM bank WHERE state  =  'New York'
Database: loan_1
Question: What are the names of banks in the state of New York?
SQL: SELECT bname FROM bank WHERE state  =  'New York'
Database: loan_1
Question: List the name of all customers sorted by their account balance in ascending order.
SQL: SELECT cust_name FROM customer ORDER BY acc_bal
Database: loan_1
Question: What are the names of all customers, ordered by account balance?
SQL: SELECT cust_name FROM customer ORDER BY acc_bal
Database: loan_1
Question: List the name of all different customers who have some loan sorted by their total loan amount.
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
Database: loan_1
Question: What are the names of the different customers who have taken out a loan, ordered by the total amount that they have taken?
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
Database: loan_1
Question: Find the state, account type, and credit score of the customer whose number of loan is 0.
SQL: SELECT state ,  acc_type ,  credit_score FROM customer WHERE no_of_loans  =  0
Database: loan_1
Question: What are the states, account types, and credit scores for customers who have 0 loans?
SQL: SELECT state ,  acc_type ,  credit_score FROM customer WHERE no_of_loans  =  0
Database: loan_1
Question: Find the number of different cities which banks are located at.
SQL: SELECT count(DISTINCT city) FROM bank
Database: loan_1
Question: In how many different cities are banks located?
SQL: SELECT count(DISTINCT city) FROM bank
Database: loan_1
Question: Find the number of different states which banks are located at.
SQL: SELECT count(DISTINCT state) FROM bank
Database: loan_1
Question: In how many different states are banks located?
SQL: SELECT count(DISTINCT state) FROM bank
Database: loan_1
Question: How many distinct types of accounts are there?
SQL: SELECT count(DISTINCT acc_type) FROM customer
Database: loan_1
Question: Count the number of different account types.
SQL: SELECT count(DISTINCT acc_type) FROM customer
Database: loan_1
Question: Find the name and account balance of the customer whose name includes the letter ‘a’.
SQL: SELECT cust_name ,  acc_bal FROM customer WHERE cust_name LIKE '%a%'
Database: loan_1
Question: What are the names and account balances of customers with the letter a in their names?
SQL: SELECT cust_name ,  acc_bal FROM customer WHERE cust_name LIKE '%a%'
Database: loan_1
Question: Find the total account balance of each customer from Utah or Texas.
SQL: SELECT sum(acc_bal) FROM customer WHERE state  =  'Utah' OR state  =  'Texas'
Database: loan_1
Question: What are the total account balances for each customer from Utah or Texas?
SQL: SELECT sum(acc_bal) FROM customer WHERE state  =  'Utah' OR state  =  'Texas'
Database: loan_1
Question: Find the name of customers who have both saving and checking account types.
SQL: SELECT cust_name FROM customer WHERE acc_type  =  'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type  =  'checking'
Database: loan_1
Question: What are the names of customers who have both savings and checking accounts?
SQL: SELECT cust_name FROM customer WHERE acc_type  =  'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type  =  'checking'
Database: loan_1
Question: Find the name of customers who do not have an saving account.
SQL: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type  =  'saving'
Database: loan_1
Question: What are the names of customers who do not have saving accounts?
SQL: SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type  =  'saving'
Database: loan_1
Question: Find the name of customers who do not have a loan with a type of Mortgages.
SQL: SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE T2.loan_type  =  'Mortgages'
Database: loan_1
Question: What are the names of customers who have not taken a Mortage loan?
SQL: SELECT cust_name FROM customer EXCEPT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE T2.loan_type  =  'Mortgages'
Database: loan_1
Question: Find the name of customers who have loans of both Mortgages and Auto.
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  'Auto'
Database: loan_1
Question: What are the names of customers who have taken both Mortgage and Auto loans?
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  'Mortgages' INTERSECT SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE loan_type  =  'Auto'
Database: loan_1
Question: Find the name of customers whose credit score is below the average credit scores of all customers.
SQL: SELECT cust_name FROM customer WHERE credit_score  <  (SELECT avg(credit_score) FROM customer)
Database: loan_1
Question: What are the names of customers with credit score less than the average credit score across customers?
SQL: SELECT cust_name FROM customer WHERE credit_score  <  (SELECT avg(credit_score) FROM customer)
Database: loan_1
Question: Find the branch name of the bank that has the most number of customers.
SQL: SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
Database: loan_1
Question: What is the name of the bank branch with the greatest number of customers?
SQL: SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1
Database: loan_1
Question: Find the name of customer who has the lowest credit score.
SQL: SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
Database: loan_1
Question: What is the name of the customer with the worst credit score?
SQL: SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1
Database: loan_1
Question: Find the name, account type, and account balance of the customer who has the highest credit score.
SQL: SELECT cust_name ,  acc_type ,  acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
Database: loan_1
Question: What is the name, account type, and account balance corresponding to the customer with the highest credit score?
SQL: SELECT cust_name ,  acc_type ,  acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1
Database: loan_1
Question: Find the name of customer who has the highest amount of loans.
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1
Database: loan_1
Question: What is the name of the customer who has greatest total loan amount?
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount) DESC LIMIT 1
Database: loan_1
Question: Find the state which has the most number of customers.
SQL: SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1
Database: loan_1
Question: Which state has the greatest total number of bank customers?
SQL: SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1
Database: loan_1
Question: For each account type, find the average account balance of customers with credit score lower than 50.
SQL: SELECT avg(acc_bal) ,  acc_type FROM customer WHERE credit_score  <  50 GROUP BY acc_type
Database: loan_1
Question: What is the average account balance of customers with credit score below 50 for the different account types?
SQL: SELECT avg(acc_bal) ,  acc_type FROM customer WHERE credit_score  <  50 GROUP BY acc_type
Database: loan_1
Question: For each state, find the total account balance of customers whose credit score is above 100.
SQL: SELECT sum(acc_bal) ,  state FROM customer WHERE credit_score  >  100 GROUP BY state
Database: loan_1
Question: What is the total account balance for customers with a credit score of above 100 for the different states?
SQL: SELECT sum(acc_bal) ,  state FROM customer WHERE credit_score  >  100 GROUP BY state
Database: loan_1
Question: Find the total amount of loans offered by each bank branch.
SQL: SELECT sum(amount) ,  T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname
Database: loan_1
Question: What are the names of the different bank branches, and what are their total loan amounts?
SQL: SELECT sum(amount) ,  T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname
Database: loan_1
Question: Find the name of customers who have more than one loan.
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING count(*)  >  1
Database: loan_1
Question: What are the names of customers who have taken out more than one loan?
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING count(*)  >  1
Database: loan_1
Question: Find the name and account balance of the customers who have loans with a total amount of more than 5000.
SQL: SELECT T1.cust_name ,  T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount)  >  5000
Database: loan_1
Question: What are the names and account balances for customers who have taken a total amount of more than 5000 in loans?
SQL: SELECT T1.cust_name ,  T1.acc_type FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id GROUP BY T1.cust_name HAVING sum(T2.amount)  >  5000
Database: loan_1
Question: Find the name of bank branch that provided the greatest total amount of loans.
SQL: SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1
Database: loan_1
Question: What is the name of the bank branch that has lent the greatest amount?
SQL: SELECT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id GROUP BY T1.bname ORDER BY sum(T2.amount) DESC LIMIT 1
Database: loan_1
Question: Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100.
SQL: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1
Database: loan_1
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?
SQL: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100 GROUP BY T2.bname ORDER BY sum(T1.amount) DESC LIMIT 1
Database: loan_1
Question: Find the name of bank branches that provided some loans.
SQL: SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id
Database: loan_1
Question: What are the names of the different banks that have provided loans?
SQL: SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id
Database: loan_1
Question: Find the name and credit score of the customers who have some loans.
SQL: SELECT DISTINCT T1.cust_name ,  T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id
Database: loan_1
Question: What are the different names and credit scores of customers who have taken a loan?
SQL: SELECT DISTINCT T1.cust_name ,  T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id
Database: loan_1
Question: Find the the name of the customers who have a loan with amount more than 3000.
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE amount  >  3000
Database: loan_1
Question: What are the names of customers who have a loan of more than 3000 in amount?
SQL: SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id  =  T2.cust_id WHERE amount  >  3000
Database: loan_1
Question: Find the city and name of bank branches that provide business loans.
SQL: SELECT T1.bname ,  T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T2.loan_type  =  'Business'
Database: loan_1
Question: What are the names and cities of bank branches that offer loans for business?
SQL: SELECT T1.bname ,  T1.city FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T2.loan_type  =  'Business'
Database: loan_1
Question: Find the names of bank branches that have provided a loan to any customer whose credit score is below 100.
SQL: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100
Database: loan_1
Question: What are the names of banks that have loaned money to customers with credit scores below 100?
SQL: SELECT T2.bname FROM loan AS T1 JOIN bank AS T2 ON T1.branch_id  =  T2.branch_id JOIN customer AS T3 ON T1.cust_id  =  T3.cust_id WHERE T3.credit_score  <  100
Database: loan_1
Question: Find the total amount of loans provided by bank branches in the state of New York.
SQL: SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T1.state  =  'New York'
Database: loan_1
Question: What is the total amount of money loaned by banks in New York state?
SQL: SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id  =  T2.branch_id WHERE T1.state  =  'New York'
Database: loan_1
Question: Find the average credit score of the customers who have some loan.
SQL: SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)
Database: loan_1
Question: What is the average credit score for customers who have taken a loan?
SQL: SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan)
Database: loan_1
Question: Find the average credit score of the customers who do not have any loan.
SQL: SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
Database: loan_1
Question: What is the average credit score for customers who have never taken a loan?
SQL: SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan)
Database: behavior_monitoring
Question: How many assessment notes are there in total?
SQL: SELECT count(*) FROM ASSESSMENT_NOTES
Database: behavior_monitoring
Question: What are the dates of the assessment notes?
SQL: SELECT date_of_notes FROM Assessment_Notes
Database: behavior_monitoring
Question: How many addresses have zip code 197?
SQL: SELECT count(*) FROM ADDRESSES WHERE zip_postcode  =  "197"
Database: behavior_monitoring
Question: How many distinct incident type codes are there?
SQL: SELECT count(DISTINCT incident_type_code) FROM Behavior_Incident
Database: behavior_monitoring
Question: Return all distinct detention type codes.
SQL: SELECT DISTINCT detention_type_code FROM Detention
Database: behavior_monitoring
Question: What are the start and end dates for incidents with incident type code "NOISE"?
SQL: SELECT date_incident_start ,  date_incident_end FROM Behavior_Incident WHERE incident_type_code  =  "NOISE"
Database: behavior_monitoring
Question: Return all detention summaries.
SQL: SELECT detention_summary FROM Detention
Database: behavior_monitoring
Question: Return the cell phone number and email address for all students.
SQL: SELECT cell_mobile_number ,  email_address FROM STUDENTS
Database: behavior_monitoring
Question: What is the email of the student with first name "Emma" and last name "Rohan"?
SQL: SELECT email_address FROM Students WHERE first_name  =  "Emma" AND last_name  =  "Rohan"
Database: behavior_monitoring
Question: How many distinct students have been in detention?
SQL: SELECT count(DISTINCT student_id) FROM Students_in_Detention
Database: behavior_monitoring
Question: What is the gender of the teacher with last name "Medhurst"?
SQL: SELECT gender FROM TEACHERS WHERE last_name  =  "Medhurst"
Database: behavior_monitoring
Question: What is the incident type description for the incident type with code "VIOLENCE"?
SQL: SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code  =  "VIOLENCE"
Database: behavior_monitoring
Question: Find the maximum and minimum monthly rental for all student addresses.
SQL: SELECT max(monthly_rental) ,  min(monthly_rental) FROM Student_Addresses
Database: behavior_monitoring
Question: Find the first names of teachers whose email address contains the word "man".
SQL: SELECT first_name FROM Teachers WHERE email_address LIKE '%man%'
Database: behavior_monitoring
Question: List all information about the assessment notes sorted by date in ascending order.
SQL: SELECT * FROM Assessment_Notes ORDER BY date_of_notes ASC
Database: behavior_monitoring
Question: List all cities of addresses in alphabetical order.
SQL: SELECT city FROM Addresses ORDER BY city
Database: behavior_monitoring
Question: Find the first names and last names of teachers in alphabetical order of last name.
SQL: SELECT first_name ,  last_name FROM Teachers ORDER BY last_name
Database: behavior_monitoring
Question: Find all information about student addresses, and sort by monthly rental in descending order.
SQL: SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC
Database: behavior_monitoring
Question: Find the id and first name of the student that has the most number of assessment notes?
SQL: SELECT T1.student_id ,  T2.first_name FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
Database: behavior_monitoring
Question: Find the ids and first names of the 3 teachers that have the most number of assessment notes?
SQL: SELECT T1.teacher_id ,  T2.first_name FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 3
Database: behavior_monitoring
Question: Find the id and last name of the student that has the most behavior incidents?
SQL: SELECT T1.student_id ,  T2.last_name FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
Database: behavior_monitoring
Question: Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"?
SQL: SELECT T1.teacher_id ,  T2.last_name FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T1.detention_type_code  =  "AFTER" GROUP BY T1.teacher_id ORDER BY count(*) DESC LIMIT 1
Database: behavior_monitoring
Question: What are the id and first name of the student whose addresses have the highest average monthly rental?
SQL: SELECT T1.student_id ,  T2.first_name FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id GROUP BY T1.student_id ORDER BY AVG(monthly_rental) DESC LIMIT 1
Database: behavior_monitoring
Question: Find the id and city of the student address with the highest average monthly rental.
SQL: SELECT T2.address_id ,  T1.city FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id GROUP BY T2.address_id ORDER BY AVG(monthly_rental) DESC LIMIT 1
Database: behavior_monitoring
Question: What are the code and description of the most frequent behavior incident type?
SQL: SELECT T1.incident_type_code ,  T2.incident_type_description FROM Behavior_Incident AS T1 JOIN Ref_Incident_Type AS T2 ON T1.incident_type_code  =  T2.incident_type_code GROUP BY T1.incident_type_code ORDER BY count(*) DESC LIMIT 1
Database: behavior_monitoring
Question: What are the code and description of the least frequent detention type ?
SQL: SELECT T1.detention_type_code ,  T2.detention_type_description FROM Detention AS T1 JOIN Ref_Detention_Type AS T2 ON T1.detention_type_code  =  T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY count(*) ASC LIMIT 1
Database: behavior_monitoring
Question: Find the dates of assessment notes for students with first name "Fanny".
SQL: SELECT T1.date_of_notes FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.first_name  =  "Fanny"
Database: behavior_monitoring
Question: Find the texts of assessment notes for teachers with last name "Schuster".
SQL: SELECT T1.text_of_notes FROM Assessment_Notes AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T2.last_name  =  "Schuster"
Database: behavior_monitoring
Question: Find the start and end dates of behavior incidents of students with last name "Fahey".
SQL: SELECT T1.date_incident_start ,  date_incident_end FROM Behavior_Incident AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id WHERE T2.last_name  =  "Fahey"
Database: behavior_monitoring
Question: Find the start and end dates of detentions of teachers with last name "Schultz".
SQL: SELECT T1.datetime_detention_start ,  datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id  =  T2.teacher_id WHERE T2.last_name  =  "Schultz"
Database: behavior_monitoring
Question: What are the id and zip code of the address with the highest monthly rental?
SQL: SELECT T2.address_id ,  T1.zip_postcode FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id ORDER BY monthly_rental DESC LIMIT 1
Database: behavior_monitoring
Question: What is the cell phone number of the student whose address has the lowest monthly rental?
SQL: SELECT T2.cell_mobile_number FROM Student_Addresses AS T1 JOIN Students AS T2 ON T1.student_id  =  T2.student_id ORDER BY T1.monthly_rental ASC LIMIT 1
Database: behavior_monitoring
Question: What are the monthly rentals of student addresses in Texas state?
SQL: SELECT T2.monthly_rental FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id WHERE T1.state_province_county  =  "Texas"
Database: behavior_monitoring
Question: What are the first names and last names of students with address in Wisconsin state?
SQL: SELECT T2.first_name ,  T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id  =  T2.address_id WHERE T1.state_province_county  =  "Wisconsin"
Database: behavior_monitoring
Question: What are the line 1 and average monthly rentals of all student addresses?
SQL: SELECT T1.line_1 ,  avg(T2.monthly_rental) FROM Addresses AS T1 JOIN Student_Addresses AS T2 ON T1.address_id  =  T2.address_id GROUP BY T2.address_id
Database: behavior_monitoring
Question: What is the zip code of the address where the teacher with first name "Lyla" lives?
SQL: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id  =  T2.address_id WHERE T2.first_name  =  "Lyla"
Database: behavior_monitoring
Question: What are the email addresses of teachers whose address has zip code "918"?
SQL: SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id  =  T2.address_id WHERE T1.zip_postcode  =  "918"
Database: behavior_monitoring
Question: How many students are not involved in any behavior incident?
SQL: SELECT count(*) FROM STUDENTS WHERE student_id NOT IN ( SELECT student_id FROM Behavior_Incident )
Database: behavior_monitoring
Question: Find the last names of teachers who are not involved in any detention.
SQL: SELECT last_name FROM Teachers EXCEPT SELECT T1.last_name FROM Teachers AS T1 JOIN Detention AS T2 ON T1.teacher_id  =  T2.teacher_id
Database: behavior_monitoring
Question: What are the line 1 of addresses shared by some students and some teachers?
SQL: SELECT T1.line_1 FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id  =  T2.address_id INTERSECT SELECT T1.line_1 FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id  =  T2.address_id
Database: assets_maintenance
Question: Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.
SQL: SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  =  2 INTERSECT SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  <  2
Database: assets_maintenance
Question: How many assets does each maintenance contract contain? List the number and the contract id.
SQL: SELECT count(*) ,  T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id  =  T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
Database: assets_maintenance
Question: How many assets does each third party company supply? List the count and the company id.
SQL: SELECT count(*) ,  T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id  =  T2.supplier_company_id GROUP BY T1.company_id
Database: assets_maintenance
Question: Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name.
SQL: SELECT T1.company_id ,  T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id  =  T2.company_id GROUP BY T1.company_id HAVING count(*)  >=  2 UNION SELECT T3.company_id ,  T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id  =  T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING count(*)  >=  2
Database: assets_maintenance
Question: What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers?
SQL: SELECT T1.staff_name ,  T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id  =  T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name ,  T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id  =  T4.contact_staff_id
Database: assets_maintenance
Question: Which engineer has visited the most times? Show the engineer id, first name and last name.
SQL: SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question: Which parts have more than 2 faults? Show the part name and id.
SQL: SELECT T1.part_name ,  T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_id HAVING count(*)  >  2
Database: assets_maintenance
Question: List all every engineer's first name, last name, details and coresponding skill description.
SQL: SELECT T1.first_name ,  T1.last_name ,  T1.other_details ,  T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id  =  T2.engineer_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
Database: assets_maintenance
Question: For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.
SQL: SELECT T1.fault_short_name ,  T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id  =  T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
Database: assets_maintenance
Question: How many assets can each parts be used in? List the part name and the number.
SQL: SELECT T1.part_name ,  count(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name
Database: assets_maintenance
Question: What are all the fault descriptions and the fault status of all the faults recoreded in the logs?
SQL: SELECT T1.fault_description ,  T2.fault_status FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id
Database: assets_maintenance
Question: How many engineer visits are required at most for a single fault log? List the number and the log entry id.
SQL: SELECT count(*) ,  T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question: What are all the distinct last names of all the engineers?
SQL: SELECT DISTINCT last_name FROM Maintenance_Engineers
Database: assets_maintenance
Question: How many fault status codes are recorded in the fault log parts table?
SQL: SELECT DISTINCT fault_status FROM Fault_Log_Parts
Database: assets_maintenance
Question: Which engineers have never visited to maintain the assets? List the engineer first name and last name.
SQL: SELECT first_name ,  last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)
Database: assets_maintenance
Question: List the asset id, details, make and model for every asset.
SQL: SELECT asset_id ,  asset_details ,  asset_make ,  asset_model FROM Assets
Database: assets_maintenance
Question: When was the first asset acquired?
SQL: SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date ASC LIMIT 1
Database: assets_maintenance
Question: Which part fault requires the most number of skills to fix? List part id and name.
SQL: SELECT T1.part_id ,  T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id  =  T3.part_fault_id GROUP BY T1.part_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question: Which kind of part has the least number of faults? List the part name.
SQL: SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name ORDER BY count(*) ASC LIMIT 1
Database: assets_maintenance
Question: Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.
SQL: SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id  =  T2.engineer_id GROUP BY T1.engineer_id ORDER BY count(*) ASC LIMIT 1
Database: assets_maintenance
Question: Which staff have contacted which engineers? List the staff name and the engineer first name and last name.
SQL: SELECT T1.staff_name ,  T3.first_name ,  T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id  =  T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id  =  T3.engineer_id
Database: assets_maintenance
Question: Which fault log included the most number of faulty parts? List the fault log id, description and record time.
SQL: SELECT T1.fault_log_entry_id ,  T1.fault_description ,  T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question: Which skill is used in fixing the most number of faults? List the skill id and description.
SQL: SELECT T1.skill_id ,  T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id  =  T2.skill_id GROUP BY T1.skill_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question: What are all the distinct asset models?
SQL: SELECT DISTINCT asset_model FROM Assets
Database: assets_maintenance
Question: List the all the assets make, model, details by the disposed date ascendingly.
SQL: SELECT asset_make ,  asset_model ,  asset_details FROM Assets ORDER BY asset_disposed_date ASC
Database: assets_maintenance
Question: Which part has the least chargeable amount? List the part id and amount.
SQL: SELECT part_id ,  chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1
Database: assets_maintenance
Question: Which company started the earliest the maintenance contract? Show the company name.
SQL: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 1
Database: assets_maintenance
Question: What is the description of the type of the company who concluded its contracts most recently?
SQL: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id JOIN Ref_Company_Types AS T3 ON T1.company_type_code  =  T3.company_type_code ORDER BY T2.contract_end_date DESC LIMIT 1
Database: assets_maintenance
Question: Which gender makes up the majority of the staff?
SQL: SELECT gender FROM staff GROUP BY gender ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question: How many engineers did each staff contact? List both the contact staff name and number of engineers contacted.
SQL: SELECT T1.staff_name ,  count(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id  =  T2.contact_staff_id GROUP BY T1.staff_name
Database: assets_maintenance
Question: Which assets did not incur any fault log? List the asset model.
SQL: SELECT asset_model FROM Assets WHERE asset_id NOT IN (SELECT asset_id FROM Fault_Log)
Database: station_weather
Question: list the local authorities and services provided by all stations.
SQL: SELECT local_authority ,  services FROM station
Database: station_weather
Question: show all train numbers and names ordered by their time from early to late.
SQL: SELECT train_number ,  name FROM train ORDER BY TIME
Database: station_weather
Question: Give me the times and numbers of all trains that go to Chennai, ordered by time.
SQL: SELECT TIME ,  train_number FROM train WHERE destination  =  'Chennai' ORDER BY TIME
Database: station_weather
Question: How many trains have 'Express' in their names?
SQL: SELECT count(*) FROM train WHERE name LIKE "%Express%"
Database: station_weather
Question: Find the number and time of the train that goes from Chennai to Guruvayur.
SQL: SELECT train_number ,  TIME FROM train WHERE origin  =  'Chennai' AND destination  =  'Guruvayur'
Database: station_weather
Question: Find the number of trains starting from each origin.
SQL: SELECT origin ,  count(*) FROM train GROUP BY origin
Database: station_weather
Question: Find the name of the train whose route runs through greatest number of stations.
SQL: SELECT t1.name FROM train AS t1 JOIN route AS t2 ON t1.id  =  t2.train_id GROUP BY t2.train_id ORDER BY count(*) DESC LIMIT 1
Database: station_weather
Question: Find the number of trains for each station, as well as the station network name and services.
SQL: SELECT count(*) ,  t1.network_name ,  t1.services FROM station AS t1 JOIN route AS t2 ON t1.id  =  t2.station_id GROUP BY t2.station_id
Database: station_weather
Question: What is the average high temperature for each day of week?
SQL: SELECT avg(high_temperature) ,  day_of_week FROM weekly_weather GROUP BY day_of_week
Database: station_weather
Question: Give me the maximum low temperature and average precipitation at the Amersham station.
SQL: SELECT max(t1.low_temperature) ,  avg(t1.precipitation) FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id WHERE t2.network_name  =  "Amersham"
Database: station_weather
Question: Find names and times of trains that run through stations for the local authority Chiltern.
SQL: SELECT t3.name ,  t3.time FROM station AS t1 JOIN route AS t2 ON t1.id  =  t2.station_id JOIN train AS t3 ON t2.train_id  =  t3.id WHERE t1.local_authority  =  "Chiltern"
Database: station_weather
Question: How many different services are provided by all stations?
SQL: SELECT count(DISTINCT services) FROM station
Database: station_weather
Question: Find the id and local authority of the station with has the highest average high temperature.
SQL: SELECT t2.id ,  t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id GROUP BY t1.station_id ORDER BY avg(high_temperature) DESC LIMIT 1
Database: station_weather
Question: Find the id and local authority of the station whose maximum precipitation is higher than 50.
SQL: SELECT t2.id ,  t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id  =  t2.id GROUP BY t1.station_id HAVING max(t1.precipitation)  >  50
Database: station_weather
Question: show the lowest low temperature and highest wind speed in miles per hour.
SQL: SELECT min(low_temperature) ,  max(wind_speed_mph) FROM weekly_weather
Database: station_weather
Question: Find the origins from which more than 1 train starts.
SQL: SELECT origin FROM train GROUP BY origin HAVING count(*)  >  1
Database: college_1
Question: Find the number of professors in accounting department.
SQL: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE DEPT_NAME  =  "Accounting"
Database: college_1
Question: How many professors are in the accounting dept?
SQL: SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code WHERE DEPT_NAME  =  "Accounting"
Database: college_1
Question: How many professors are teaching class with code ACCT-211?
SQL: SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE  =  "ACCT-211"
Database: college_1
Question: How many professors teach a class with the code ACCT-211?
SQL: SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE  =  "ACCT-211"
Database: college_1
Question: What is the first and last name of the professor in biology department?
SQL: SELECT T3.EMP_FNAME ,  T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM  =  T3.EMP_NUM WHERE DEPT_NAME  =  "Biology"
Database: college_1
Question: What are the first and last name of all biology professors?
SQL: SELECT T3.EMP_FNAME ,  T3.EMP_LNAME FROM professor AS T1 JOIN department AS T2 ON T1.dept_code  =  T2.dept_code JOIN employee AS T3 ON T1.EMP_NUM  =  T3.EMP_NUM WHERE DEPT_NAME  =  "Biology"
Database: college_1
Question: What are the first names and date of birth of professors teaching course ACCT-211?
SQL: SELECT DISTINCT T1.EMP_FNAME ,  T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE CRS_CODE  =  "ACCT-211"
Database: college_1
Question: What are the first names and birthdates of the professors in charge of ACCT-211?
SQL: SELECT DISTINCT T1.EMP_FNAME ,  T1.EMP_DOB FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE CRS_CODE  =  "ACCT-211"
Database: college_1
Question: How many classes are professor whose last name is Graztevski has?
SQL: SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE T1.EMP_LNAME  =  'Graztevski'
Database: college_1
Question: How many classes does the professor whose last name is Graztevski teach?
SQL: SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM  =  T2.PROF_NUM WHERE T1.EMP_LNAME  =  'Graztevski'
Database: college_1
Question: What is the code of the school where the accounting department belongs to?
SQL: SELECT school_code FROM department WHERE dept_name  =  "Accounting"
Database: college_1
Question: What is the school code of the accounting department?
SQL: SELECT school_code FROM department WHERE dept_name  =  "Accounting"
Database: college_1
Question: How many credits does course CIS-220 have, and what its description?
SQL: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  'CIS-220'
Database: college_1
Question: What is the description for the CIS-220 and how many credits does it have?
SQL: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  'CIS-220'
Database: college_1
Question: what is the address of history department?
SQL: SELECT dept_address FROM department WHERE dept_name  =  'History'
Database: college_1
Question: Where is the history department?
SQL: SELECT dept_address FROM department WHERE dept_name  =  'History'
Database: college_1
Question: How many different locations does the school with code BUS has?
SQL: SELECT count(DISTINCT dept_address) FROM department WHERE school_code  =  'BUS'
Database: college_1
Question: What are the different locations of the school with the code BUS?
SQL: SELECT count(DISTINCT dept_address) FROM department WHERE school_code  =  'BUS'
Database: college_1
Question: How many different locations does each school have?
SQL: SELECT count(DISTINCT dept_address) ,  school_code FROM department GROUP BY school_code
Database: college_1
Question: Count different addresses of each school.
SQL: SELECT count(DISTINCT dept_address) ,  school_code FROM department GROUP BY school_code
Database: college_1
Question: Find the description and credit for the course QM-261?
SQL: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  'QM-261'
Database: college_1
Question: What is the course description and number of credits for QM-261?
SQL: SELECT crs_credit ,  crs_description FROM course WHERE crs_code  =  'QM-261'
Database: college_1
Question: Find the number of departments in each school.
SQL: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code
Database: college_1
Question: How many departments are in each school?
SQL: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code
Database: college_1
Question: Find the number of different departments in each school whose number of different departments is less than 5.
SQL: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  5
Database: college_1
Question: How many different departments are there in each school that has less than 5 apartments?
SQL: SELECT count(DISTINCT dept_name) ,  school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name)  <  5
Database: college_1
Question: How many sections does each course has?
SQL: SELECT count(*) ,  crs_code FROM CLASS GROUP BY crs_code
Database: college_1
Question: How many sections does each course have?
SQL: SELECT count(*) ,  crs_code FROM CLASS GROUP BY crs_code
Database: college_1
Question: What is the total credit does each department offer?
SQL: SELECT sum(crs_credit) ,  dept_code FROM course GROUP BY dept_code
Database: college_1
Question: How many credits does the department offer?
SQL: SELECT sum(crs_credit) ,  dept_code FROM course GROUP BY dept_code
Database: college_1
Question: Find the number of classes offered for all class rooms that held at least 2 classes.
SQL: SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2
Database: college_1
Question: For each classroom with at least 2 classes, how many classes are offered?
SQL: SELECT count(*) ,  class_room FROM CLASS GROUP BY class_room HAVING count(*)  >=  2
Database: college_1
Question: Find the number of classes in each department.
SQL: SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code
Database: college_1
Question: How many classes are held in each department?
SQL: SELECT count(*) ,  dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code GROUP BY dept_code
Database: college_1
Question: Find the number of classes in each school.
SQL: SELECT count(*) ,  T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T2.dept_code  =  T3.dept_code GROUP BY T3.school_code
Database: college_1
Question: How many classes exist for each school?
SQL: SELECT count(*) ,  T3.school_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code  =  T2.crs_code JOIN department AS T3 ON T2.dept_code  =  T3.dept_code GROUP BY T3.school_code