db_id
stringclasses 31
values | schema
stringclasses 22
values | schemaComEx
stringclasses 22
values | question
stringlengths 18
181
| query
stringlengths 20
577
| answer
stringlengths 14
41.7k
⌀ | complexity
stringclasses 4
values | distinct
bool 2
classes | like
bool 2
classes | between
bool 2
classes | order_by
bool 2
classes | limit
bool 2
classes | grouby_by
bool 2
classes | having
bool 2
classes | single_join
bool 2
classes | multiple_join
bool 2
classes | multiple_select
bool 2
classes | intersect
bool 2
classes | except
bool 2
classes | union
bool 2
classes |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
loan_1 | null | null | Find the number of different cities which banks are located at. | SELECT count(DISTINCT city) FROM bank | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | In how many different cities are banks located? | SELECT count(DISTINCT city) FROM bank | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the number of different states which banks are located at. | SELECT count(DISTINCT state) FROM bank | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | In how many different states are banks located? | SELECT count(DISTINCT state) FROM bank | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | How many distinct types of accounts are there? | SELECT count(DISTINCT acc_type) FROM customer | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Count the number of different account types. | SELECT count(DISTINCT acc_type) FROM customer | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name and account balance of the customer whose name includes the letter ‘a’. | SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names and account balances of customers with the letter a in their names? | SELECT cust_name , acc_bal FROM customer WHERE cust_name LIKE '%a%' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the total account balance of each customer from Utah or Texas. | SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the total account balances for each customer from Utah or Texas? | SELECT sum(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of customers who have both saving and checking account types. | SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of customers who have both savings and checking accounts? | SELECT cust_name FROM customer WHERE acc_type = 'saving' INTERSECT SELECT cust_name FROM customer WHERE acc_type = 'checking' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of customers who do not have an saving account. | SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of customers who do not have saving accounts? | SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of customers who do not have a loan with a type of Mortgages. | 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' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of customers who have not taken a Mortage loan? | 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' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of customers who have loans of both Mortgages and Auto. | 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' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of customers who have taken both Mortgage and Auto loans? | 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' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of customers whose credit score is below the average credit scores of all customers. | SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer) | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of customers with credit score less than the average credit score across customers? | SELECT cust_name FROM customer WHERE credit_score < (SELECT avg(credit_score) FROM customer) | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the branch name of the bank that has the most number of customers. | SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the name of the bank branch with the greatest number of customers? | SELECT bname FROM bank ORDER BY no_of_customers DESC LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of customer who has the lowest credit score. | SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the name of the customer with the worst credit score? | SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name, account type, and account balance of the customer who has the highest credit score. | SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the name, account type, and account balance corresponding to the customer with the highest credit score? | SELECT cust_name , acc_type , acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of customer who has the highest amount of loans. | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the name of the customer who has greatest total loan amount? | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the state which has the most number of customers. | SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Which state has the greatest total number of bank customers? | SELECT state FROM bank GROUP BY state ORDER BY sum(no_of_customers) DESC LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | For each account type, find the average account balance of customers with credit score lower than 50. | SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the average account balance of customers with credit score below 50 for the different account types? | SELECT avg(acc_bal) , acc_type FROM customer WHERE credit_score < 50 GROUP BY acc_type | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | For each state, find the total account balance of customers whose credit score is above 100. | SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the total account balance for customers with a credit score of above 100 for the different states? | SELECT sum(acc_bal) , state FROM customer WHERE credit_score > 100 GROUP BY state | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the total amount of loans offered by each bank branch. | SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of the different bank branches, and what are their total loan amounts? | SELECT sum(amount) , T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id GROUP BY T1.bname | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of customers who have more than one loan. | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of customers who have taken out more than one loan? | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name and account balance of the customers who have loans with a total amount of more than 5000. | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names and account balances for customers who have taken a total amount of more than 5000 in loans? | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of bank branch that provided the greatest total amount of loans. | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the name of the bank branch that has lent the greatest amount? | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of bank branch that provided the greatest total amount of loans to customers with credit score is less than 100. | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | 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? | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name of bank branches that provided some loans. | SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of the different banks that have provided loans? | SELECT DISTINCT T1.bname FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the name and credit score of the customers who have some loans. | SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the different names and credit scores of customers who have taken a loan? | SELECT DISTINCT T1.cust_name , T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the the name of the customers who have a loan with amount more than 3000. | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of customers who have a loan of more than 3000 in amount? | SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id WHERE amount > 3000 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the city and name of bank branches that provide business loans. | 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' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names and cities of bank branches that offer loans for business? | 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' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the names of bank branches that have provided a loan to any customer whose credit score is below 100. | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What are the names of banks that have loaned money to customers with credit scores below 100? | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the total amount of loans provided by bank branches in the state of New York. | SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the total amount of money loaned by banks in New York state? | SELECT sum(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the average credit score of the customers who have some loan. | SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan) | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the average credit score for customers who have taken a loan? | SELECT avg(credit_score) FROM customer WHERE cust_id IN (SELECT cust_id FROM loan) | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | Find the average credit score of the customers who do not have any loan. | SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan) | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
loan_1 | null | null | What is the average credit score for customers who have never taken a loan? | SELECT avg(credit_score) FROM customer WHERE cust_id NOT IN (SELECT cust_id FROM loan) | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Find the number of professors in accounting department. | SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = "Accounting" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many professors are in the accounting dept? | SELECT count(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE DEPT_NAME = "Accounting" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many professors are teaching class with code ACCT-211? | SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = "ACCT-211" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many professors teach a class with the code ACCT-211? | SELECT count(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = "ACCT-211" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What is the first and last name of the professor in biology department? | 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" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What are the first and last name of all biology professors? | 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" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What are the first names and date of birth of professors teaching course ACCT-211? | 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" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What are the first names and birthdates of the professors in charge of ACCT-211? | 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" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many classes are professor whose last name is Graztevski has? | SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many classes does the professor whose last name is Graztevski teach? | SELECT count(*) FROM employee AS T1 JOIN CLASS AS T2 ON T1.EMP_NUM = T2.PROF_NUM WHERE T1.EMP_LNAME = 'Graztevski' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What is the code of the school where the accounting department belongs to? | SELECT school_code FROM department WHERE dept_name = "Accounting" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What is the school code of the accounting department? | SELECT school_code FROM department WHERE dept_name = "Accounting" | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many credits does course CIS-220 have, and what its description? | SELECT crs_credit , crs_description FROM course WHERE crs_code = 'CIS-220' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What is the description for the CIS-220 and how many credits does it have? | SELECT crs_credit , crs_description FROM course WHERE crs_code = 'CIS-220' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | what is the address of history department? | SELECT dept_address FROM department WHERE dept_name = 'History' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Where is the history department? | SELECT dept_address FROM department WHERE dept_name = 'History' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many different locations does the school with code BUS has? | SELECT count(DISTINCT dept_address) FROM department WHERE school_code = 'BUS' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What are the different locations of the school with the code BUS? | SELECT count(DISTINCT dept_address) FROM department WHERE school_code = 'BUS' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many different locations does each school have? | SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Count different addresses of each school. | SELECT count(DISTINCT dept_address) , school_code FROM department GROUP BY school_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Find the description and credit for the course QM-261? | SELECT crs_credit , crs_description FROM course WHERE crs_code = 'QM-261' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What is the course description and number of credits for QM-261? | SELECT crs_credit , crs_description FROM course WHERE crs_code = 'QM-261' | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Find the number of departments in each school. | SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many departments are in each school? | SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Find the number of different departments in each school whose number of different departments is less than 5. | SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name) < 5 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many different departments are there in each school that has less than 5 apartments? | SELECT count(DISTINCT dept_name) , school_code FROM department GROUP BY school_code HAVING count(DISTINCT dept_name) < 5 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many sections does each course has? | SELECT count(*) , crs_code FROM CLASS GROUP BY crs_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many sections does each course have? | SELECT count(*) , crs_code FROM CLASS GROUP BY crs_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What is the total credit does each department offer? | SELECT sum(crs_credit) , dept_code FROM course GROUP BY dept_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many credits does the department offer? | SELECT sum(crs_credit) , dept_code FROM course GROUP BY dept_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Find the number of classes offered for all class rooms that held at least 2 classes. | SELECT count(*) , class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | For each classroom with at least 2 classes, how many classes are offered? | SELECT count(*) , class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Find the number of classes in each department. | SELECT count(*) , dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many classes are held in each department? | SELECT count(*) , dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Find the number of classes in each school. | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many classes exist for each school? | 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 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What is the number of professors for different school? | SELECT count(*) , T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | How many different professors are there for the different schools? | SELECT count(*) , T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | Find the count and code of the job has most employees. | SELECT emp_jobcode , count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |
college_1 | null | null | What is the count and code of the job with the most employee? | SELECT emp_jobcode , count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null |