question string | answer string | context string | dialect string | spider_hardness string | extended_hardness string | classification_status string | syntax_status string | ddl_syntax_status string | schema_status string | syntax_errors list | ddl_syntax_errors list | schema_errors list | classification_errors list | status_history list | correction_status string | component1 int64 | component2 int64 | others int64 | validation_source dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Find the state, account type, and credit score of the customer whose number of loan is 0. | SELECT state, acc_type, credit_score FROM customer WHERE no_of_loans = 0 | CREATE TABLE customer (state VARCHAR(255), acc_type VARCHAR(255), credit_score VARCHAR(255), no_of_loans VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1782
} |
Find the number of different cities which banks are located at. | SELECT COUNT(DISTINCT city) FROM bank | CREATE TABLE bank (city VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1783
} |
Find the number of different states which banks are located at. | SELECT COUNT(DISTINCT state) FROM bank | CREATE TABLE bank (state VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1784
} |
How many distinct types of accounts are there? | SELECT COUNT(DISTINCT acc_type) FROM customer | CREATE TABLE customer (acc_type VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1785
} |
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%' | CREATE TABLE customer (cust_name VARCHAR(255), acc_bal VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1786
} |
Find the total account balance of each customer from Utah or Texas. | SELECT SUM(acc_bal) FROM customer WHERE state = 'Utah' OR state = 'Texas' | CREATE TABLE customer (acc_bal INTEGER, state VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1787
} |
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' | CREATE TABLE customer (cust_name VARCHAR(255), acc_type VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 1788
} |
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' | CREATE TABLE customer (cust_name VARCHAR(255), acc_type VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 1 | 0 | {
"split": "train",
"row_index": 1789
} |
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) | CREATE TABLE customer (cust_name VARCHAR(255), credit_score INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 1792
} |
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 | CREATE TABLE bank (bname VARCHAR(255), no_of_customers VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1793
} |
Find the name of customer who has the lowest credit score. | SELECT cust_name FROM customer ORDER BY credit_score LIMIT 1 | CREATE TABLE customer (cust_name VARCHAR(255), credit_score VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1794
} |
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 | CREATE TABLE customer (cust_name VARCHAR(255), acc_type VARCHAR(255), acc_bal VARCHAR(255), credit_score VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1795
} |
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 | CREATE TABLE loan (cust_id VARCHAR(255), amount INTEGER); CREATE TABLE customer (cust_name VARCHAR(255), cust_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 1796
} |
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 | CREATE TABLE bank (state VARCHAR(255), no_of_customers INTEGER) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 1797
} |
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 | CREATE TABLE customer (acc_type VARCHAR(255), acc_bal INTEGER, credit_score INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1798
} |
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 | CREATE TABLE customer (state VARCHAR(255), acc_bal INTEGER, credit_score INTEGER) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1799
} |
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 | CREATE TABLE customer (cust_name VARCHAR(255), cust_id VARCHAR(255)); CREATE TABLE loan (cust_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1801
} |
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 | CREATE TABLE loan (cust_id VARCHAR(255), amount INTEGER); CREATE TABLE customer (cust_name VARCHAR(255), acc_type VARCHAR(255), cust_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1802
} |
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 | CREATE TABLE loan (branch_id VARCHAR(255), amount INTEGER, id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE bank (bname VARCHAR(255), branch_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 1803
} |
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 | CREATE TABLE loan (branch_id VARCHAR(255), cust_id VARCHAR(255), amount INTEGER); CREATE TABLE bank (bname VARCHAR(255), branch_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE customer (cust_id VARCHAR(255), credit_score INTEGER) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 6 | 0 | 0 | {
"split": "train",
"row_index": 1804
} |
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 | CREATE TABLE loan (branch_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE bank (bname VARCHAR(255), branch_id VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1805
} |
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 | CREATE TABLE customer (cust_name VARCHAR(255), credit_score VARCHAR(255), cust_id VARCHAR(255)); CREATE TABLE loan (cust_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1806
} |
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' | CREATE TABLE bank (bname VARCHAR(255), city VARCHAR(255), branch_id VARCHAR(255)); CREATE TABLE loan (branch_id VARCHAR(255), loan_type VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1808
} |
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 | CREATE TABLE bank (bname VARCHAR(255), branch_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE customer (cust_id VARCHAR(255), credit_score INTEGER); CREATE TABLE loan (branch_id VARCHAR(255), cust_id VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 1809
} |
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' | CREATE TABLE bank (branch_id VARCHAR(255), state VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE loan (amount INTEGER, branch_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1810
} |
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) | CREATE TABLE loan (credit_score INTEGER, cust_id VARCHAR(255)); CREATE TABLE customer (credit_score INTEGER, cust_id VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 1811
} |
Find the average credit score of the customers who do not have any loan. | SELECT AVG(credit_score) FROM customer WHERE NOT cust_id IN (SELECT cust_id FROM loan) | CREATE TABLE loan (credit_score INTEGER, cust_id VARCHAR(255)); CREATE TABLE customer (credit_score INTEGER, cust_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 1 | {
"split": "train",
"row_index": 1812
} |
How many assessment notes are there in total? | SELECT COUNT(*) FROM ASSESSMENT_NOTES | CREATE TABLE ASSESSMENT_NOTES (Id VARCHAR(255), note VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1813
} |
What are the dates of the assessment notes? | SELECT date_of_notes FROM Assessment_Notes | CREATE TABLE Assessment_Notes (date_of_notes VARCHAR(255), note VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1814
} |
How many addresses have zip code 197? | SELECT COUNT(*) FROM ADDRESSES WHERE zip_postcode = '197' | CREATE TABLE ADDRESSES (zip_postcode VARCHAR(255), street_address VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1815
} |
How many distinct incident type codes are there? | SELECT COUNT(DISTINCT incident_type_code) FROM Behavior_Incident | CREATE TABLE Behavior_Incident (incident_type_code VARCHAR(255), incident_type_description VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1816
} |
Return all distinct detention type codes. | SELECT DISTINCT detention_type_code FROM Detention | CREATE TABLE Detention (detention_type_code VARCHAR(255), detention_description VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1817
} |
What are the start and end dates for incidents with incident type code "NOISE"? | SELECT date_incident_start, date_incident_end FROM Behavior_Incident WHERE incident_type_code = 'NOISE' | CREATE TABLE Behavior_Incident (date_incident_start VARCHAR(255), date_incident_end VARCHAR(255), incident_type_code VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1818
} |
Return all detention summaries. | SELECT detention_summary FROM Detention | CREATE TABLE Detention (detention_summary VARCHAR(255), detention_id VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1819
} |
Return the cell phone number and email address for all students. | SELECT cell_mobile_number, email_address FROM STUDENTS | CREATE TABLE STUDENTS (cell_mobile_number VARCHAR(255), email_address VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 1 | {
"split": "train",
"row_index": 1820
} |
What is the email of the student with first name "Emma" and last name "Rohan"? | SELECT email_address FROM Students WHERE first_name = 'Emma' AND last_name = 'Rohan' | CREATE TABLE Students (email_address VARCHAR(255), first_name VARCHAR(255), last_name VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1821
} |
How many distinct students have been in detention? | SELECT COUNT(DISTINCT student_id) FROM Students_in_Detention | CREATE TABLE Students_in_Detention (student_id VARCHAR(255), detention_date VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1822
} |
What is the gender of the teacher with last name "Medhurst"? | SELECT gender FROM TEACHERS WHERE last_name = 'Medhurst' | CREATE TABLE TEACHERS (gender VARCHAR(255), last_name VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1823
} |
What is the incident type description for the incident type with code "VIOLENCE"? | SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code = 'VIOLENCE' | CREATE TABLE Ref_Incident_Type (incident_type_description VARCHAR(255), incident_type_code VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1824
} |
Find the maximum and minimum monthly rental for all student addresses. | SELECT MAX(monthly_rental), MIN(monthly_rental) FROM Student_Addresses | CREATE TABLE Student_Addresses (monthly_rental INTEGER, address_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 2 | {
"split": "train",
"row_index": 1825
} |
Find the first names of teachers whose email address contains the word "man". | SELECT first_name FROM Teachers WHERE email_address LIKE '%man%' | CREATE TABLE Teachers (first_name VARCHAR(255), email_address VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1826
} |
List all cities of addresses in alphabetical order. | SELECT city FROM Addresses ORDER BY city | CREATE TABLE Addresses (city VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1828
} |
Find the first names and last names of teachers in alphabetical order of last name. | SELECT first_name, last_name FROM Teachers ORDER BY last_name | CREATE TABLE Teachers (first_name VARCHAR(255), last_name VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1829
} |
Find the id and first name of the student that has the most number of assessment notes? | 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 | CREATE TABLE Students (first_name VARCHAR(255), student_id VARCHAR(255)); CREATE TABLE Assessment_Notes (student_id VARCHAR(255), note VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1831
} |
Find the ids and first names of the 3 teachers that have the most number of assessment notes? | 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 | CREATE TABLE Assessment_Notes (teacher_id VARCHAR(255), note VARCHAR(255)); CREATE TABLE Teachers (first_name VARCHAR(255), teacher_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1832
} |
Find the id and last name of the student that has the most behavior incidents? | 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 | CREATE TABLE Students (last_name VARCHAR(255), student_id VARCHAR(255)); CREATE TABLE Behavior_Incident (student_id VARCHAR(255), incident_date DATE) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1833
} |
Find the id and last name of the teacher that has the most detentions with detention type code "AFTER"? | 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 | CREATE TABLE Detention (teacher_id VARCHAR(255), detention_type_code VARCHAR(255)); CREATE TABLE Teachers (last_name VARCHAR(255), teacher_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 5 | 0 | 1 | {
"split": "train",
"row_index": 1834
} |
What are the code and description of the most frequent behavior incident type? | 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 | CREATE TABLE Ref_Incident_Type (incident_type_description VARCHAR(255), incident_type_code VARCHAR(255)); CREATE TABLE Behavior_Incident (incident_type_code VARCHAR(255), occurrence_date DATE) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1837
} |
What are the code and description of the least frequent detention type ? | 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(*) LIMIT 1 | CREATE TABLE Ref_Detention_Type (detention_type_description VARCHAR(255), detention_type_code VARCHAR(255)); CREATE TABLE Detention (detention_type_code VARCHAR(255), detention_date DATE) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1838
} |
Find the dates of assessment notes for students with first name "Fanny". | 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' | CREATE TABLE Students (student_id VARCHAR(255), first_name VARCHAR(255)); CREATE TABLE Assessment_Notes (date_of_notes VARCHAR(255), student_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1839
} |
Find the texts of assessment notes for teachers with last name "Schuster". | 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' | CREATE TABLE Assessment_Notes (text_of_notes VARCHAR(255), teacher_id VARCHAR(255)); CREATE TABLE Teachers (teacher_id VARCHAR(255), last_name VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1840
} |
What is the cell phone number of the student whose address has the lowest monthly rental? | 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 LIMIT 1 | CREATE TABLE Students (cell_mobile_number VARCHAR(255), student_id VARCHAR(255)); CREATE TABLE Student_Addresses (student_id VARCHAR(255), monthly_rental VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 1844
} |
What are the monthly rentals of student addresses in Texas state? | 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' | CREATE TABLE Addresses (address_id VARCHAR(255), state_province_county VARCHAR(255)); CREATE TABLE Student_Addresses (monthly_rental VARCHAR(255), address_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1845
} |
What are the first names and last names of students with address in Wisconsin state? | 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' | CREATE TABLE Addresses (address_id VARCHAR(255), state_province_county VARCHAR(255)); CREATE TABLE Students (first_name VARCHAR(255), last_name VARCHAR(255), address_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1846
} |
What are the line 1 and average monthly rentals of all student addresses? | 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 | CREATE TABLE Addresses (line_1 VARCHAR(255), address_id VARCHAR(255)); CREATE TABLE Student_Addresses (monthly_rental INTEGER, address_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1847
} |
What is the zip code of the address where the teacher with first name "Lyla" lives? | SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'Lyla' | CREATE TABLE Teachers (address_id VARCHAR(255), first_name VARCHAR(255)); CREATE TABLE Addresses (zip_postcode VARCHAR(255), address_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1848
} |
What are the email addresses of teachers whose address has zip code "918"? | SELECT T2.email_address FROM Addresses AS T1 JOIN Teachers AS T2 ON T1.address_id = T2.address_id WHERE T1.zip_postcode = '918' | CREATE TABLE Addresses (address_id VARCHAR(255), zip_postcode VARCHAR(255)); CREATE TABLE Teachers (email_address VARCHAR(255), address_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1849
} |
How many students are not involved in any behavior incident? | SELECT COUNT(*) FROM STUDENTS WHERE NOT student_id IN (SELECT student_id FROM Behavior_Incident) | CREATE TABLE STUDENTS (student_id VARCHAR(255), name VARCHAR(255)); CREATE TABLE Behavior_Incident (student_id VARCHAR(255), incident_id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 1 | {
"split": "train",
"row_index": 1850
} |
What are the line 1 of addresses shared by some students and some teachers? | 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 | CREATE TABLE Teachers (address_id VARCHAR(255), teacher_name VARCHAR(255)); CREATE TABLE Students (address_id VARCHAR(255), student_name VARCHAR(255)); CREATE TABLE Addresses (line_1 VARCHAR(255), address_id VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 0 | {
"split": "train",
"row_index": 1852
} |
Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail. | 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 | CREATE TABLE Assets (asset_id VARCHAR(255), asset_details VARCHAR(255)); CREATE TABLE Asset_Parts (asset_id VARCHAR(255), part_id VARCHAR(255)); CREATE TABLE Fault_Log (asset_id VARCHAR(255), fault_log_entry_id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 1 | {
"split": "train",
"row_index": 1853
} |
How many assets does each maintenance contract contain? List the number and the contract id. | 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 | CREATE TABLE Assets (maintenance_contract_id VARCHAR(255), asset_id VARCHAR(255)); CREATE TABLE Maintenance_Contracts (maintenance_contract_id VARCHAR(255), contract_name VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1854
} |
How many assets does each third party company supply? List the count and the company id. | 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 | CREATE TABLE Assets (supplier_company_id VARCHAR(255), asset_id VARCHAR(255)); CREATE TABLE Third_Party_Companies (company_id VARCHAR(255), company_name VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1855
} |
Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name. | 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.mainten... | CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR(255), contract_id VARCHAR(255)); CREATE TABLE Maintenance_Engineers (company_id VARCHAR(255), engineer_id VARCHAR(255)); CREATE TABLE Third_Party_Companies (company_id VARCHAR(255), company_name VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 1 | 1 | {
"split": "train",
"row_index": 1856
} |
What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers? | 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 | CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR(255), visit_id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Staff (staff_name VARCHAR(255), staff_id VARCHAR(255)); CREATE TABLE Fault_Log (recorded_by_staff_id VARCHAR(255), fault_log_entry_id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 1 | {
"split": "train",
"row_index": 1857
} |
Which engineer has visited the most times? Show the engineer id, first name and last name. | 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 | CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR(255), first_name VARCHAR(255), last_name VARCHAR(255)); CREATE TABLE Engineer_Visits (Id VARCHAR(255), engineer_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1858
} |
Which parts have more than 2 faults? Show the part name and id. | 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 | CREATE TABLE Parts (part_name VARCHAR(255), part_id VARCHAR(255)); CREATE TABLE Part_Faults (part_id VARCHAR(255), fault_id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1859
} |
List all every engineer's first name, last name, details and coresponding skill description. | 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 | CREATE TABLE Maintenance_Engineers (first_name VARCHAR(255), last_name VARCHAR(255), other_details VARCHAR(255), engineer_id VARCHAR(255)); CREATE TABLE Engineer_Skills (engineer_id VARCHAR(255), skill_id VARCHAR(255)); CREATE TABLE Skills (skill_description VARCHAR(255), skill_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1860
} |
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. | 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 | CREATE TABLE Skills_Required_To_Fix (part_fault_id VARCHAR(255), skill_id VARCHAR(255)); CREATE TABLE Part_Faults (fault_short_name VARCHAR(255), part_fault_id VARCHAR(255)); CREATE TABLE Skills (skill_description VARCHAR(255), skill_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1861
} |
How many assets can each parts be used in? List the part name and the number. | 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 | CREATE TABLE Parts (part_name VARCHAR(255), part_id VARCHAR(255)); CREATE TABLE Asset_Parts (part_id VARCHAR(255), asset_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1862
} |
What are all the fault descriptions and the fault status of all the faults recoreded in the logs? | 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 | CREATE TABLE Fault_Log (fault_description VARCHAR(255), fault_log_entry_id VARCHAR(255)); CREATE TABLE Fault_Log_Parts (fault_status VARCHAR(255), fault_log_entry_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1863
} |
How many engineer visits are required at most for a single fault log? List the number and the log entry id. | 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 | CREATE TABLE Fault_Log (fault_log_entry_id VARCHAR(255), description VARCHAR(255)); CREATE TABLE Engineer_Visits (fault_log_entry_id VARCHAR(255), visit_id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 2 | {
"split": "train",
"row_index": 1864
} |
What are all the distinct last names of all the engineers? | SELECT DISTINCT last_name FROM Maintenance_Engineers | CREATE TABLE Maintenance_Engineers (last_name VARCHAR(255), engineer_id VARCHAR(255), first_name VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1865
} |
How many fault status codes are recorded in the fault log parts table? | SELECT DISTINCT fault_status FROM Fault_Log_Parts | CREATE TABLE Fault_Log_Parts (fault_status VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1866
} |
Which engineers have never visited to maintain the assets? List the engineer first name and last name. | SELECT first_name, last_name FROM Maintenance_Engineers WHERE NOT engineer_id IN (SELECT engineer_id FROM Engineer_Visits) | CREATE TABLE Engineer_Visits (first_name VARCHAR(255), last_name VARCHAR(255), engineer_id VARCHAR(255)); CREATE TABLE Maintenance_Engineers (first_name VARCHAR(255), last_name VARCHAR(255), engineer_id VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 1 | 1 | {
"split": "train",
"row_index": 1867
} |
List the asset id, details, make and model for every asset. | SELECT asset_id, asset_details, asset_make, asset_model FROM Assets | CREATE TABLE Assets (asset_id VARCHAR(255), asset_details VARCHAR(255), asset_make VARCHAR(255), asset_model VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 1 | {
"split": "train",
"row_index": 1868
} |
When was the first asset acquired? | SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date LIMIT 1 | CREATE TABLE Assets (asset_acquired_date VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1869
} |
Which part fault requires the most number of skills to fix? List part id and name. | 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 | CREATE TABLE Part_Faults (part_id VARCHAR(255), part_fault_id VARCHAR(255)); CREATE TABLE Skills_Required_To_Fix (part_fault_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Parts (part_id VARCHAR(255), part_name VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 5 | 0 | 1 | {
"split": "train",
"row_index": 1870
} |
Which kind of part has the least number of faults? List the part name. | 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(*) LIMIT 1 | CREATE TABLE Parts (part_name VARCHAR(255), part_id VARCHAR(255)); CREATE TABLE Part_Faults (part_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 1871
} |
Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name. | 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(*) LIMIT 1 | CREATE TABLE Engineer_Visits (engineer_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR(255), first_name VARCHAR(255), last_name VARCHAR(255)) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1872
} |
Which staff have contacted which engineers? List the staff name and the engineer first name and last name. | 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 | CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR(255), engineer_id VARCHAR(255)); CREATE TABLE Staff (staff_name VARCHAR(255), staff_id VARCHAR(255)); CREATE TABLE Maintenance_Engineers (first_name VARCHAR(255), last_name VARCHAR(255), engineer_id VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1873
} |
Which fault log included the most number of faulty parts? List the fault log id, description and record time. | 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 | CREATE TABLE Fault_Log (fault_log_entry_id VARCHAR(255), fault_description VARCHAR(255), fault_log_entry_datetime VARCHAR(255)); CREATE TABLE Fault_Log_Parts (fault_log_entry_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1874
} |
Which skill is used in fixing the most number of faults? List the skill id and description. | 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 | CREATE TABLE Skills (skill_id VARCHAR(255), skill_description VARCHAR(255)); CREATE TABLE Skills_Required_To_Fix (skill_id VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 1 | {
"split": "train",
"row_index": 1875
} |
What are all the distinct asset models? | SELECT DISTINCT asset_model FROM Assets | CREATE TABLE Assets (asset_model VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1876
} |
List the all the assets make, model, details by the disposed date ascendingly. | SELECT asset_make, asset_model, asset_details FROM Assets ORDER BY asset_disposed_date | CREATE TABLE Assets (asset_make VARCHAR(255), asset_model VARCHAR(255), asset_details VARCHAR(255), asset_disposed_date VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1877
} |
Which part has the least chargeable amount? List the part id and amount. | SELECT part_id, chargeable_amount FROM Parts ORDER BY chargeable_amount LIMIT 1 | CREATE TABLE Parts (part_id VARCHAR(255), chargeable_amount VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1878
} |
Which company started the earliest the maintenance contract? Show the company name. | 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 LIMIT 1 | CREATE TABLE Third_Party_Companies (company_name VARCHAR(255), company_id VARCHAR(255)); CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR(255), contract_start_date VARCHAR(255)) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 1879
} |
What is the description of the type of the company who concluded its contracts most recently? | 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 | CREATE TABLE Maintenance_Contracts (maintenance_contract_company_id VARCHAR(255), contract_end_date VARCHAR(255)); CREATE TABLE Third_Party_Companies (company_name VARCHAR(255), company_id VARCHAR(255), company_type_code VARCHAR(255)); CREATE TABLE Ref_Company_Types (company_type_code VARCHAR(255), id INTEGER PRIMARY K... | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 1880
} |
Which gender makes up the majority of the staff? | SELECT gender FROM staff GROUP BY gender ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE staff (gender VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | hard | hard | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 3 | 0 | 0 | {
"split": "train",
"row_index": 1881
} |
How many engineers did each staff contact? List both the contact staff name and number of engineers contacted. | 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 | CREATE TABLE Engineer_Visits (contact_staff_id VARCHAR, id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE Staff (staff_name VARCHAR, staff_id VARCHAR) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1882
} |
How many trains have 'Express' in their names? | SELECT COUNT(*) FROM train WHERE name LIKE '%Express%' | CREATE TABLE train (name VARCHAR, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1887
} |
Find the number of trains starting from each origin. | SELECT origin, COUNT(*) FROM train GROUP BY origin | CREATE TABLE train (origin VARCHAR, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1889
} |
Find the name of the train whose route runs through greatest number of stations. | 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 | CREATE TABLE route (train_id VARCHAR, id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE train (name VARCHAR, id VARCHAR) | generic | extra | extra | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 4 | 0 | 0 | {
"split": "train",
"row_index": 1890
} |
Find the number of trains for each station, as well as the station network name and services. | 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 | CREATE TABLE route (station_id VARCHAR, id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE station (network_name VARCHAR, services VARCHAR, id VARCHAR) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 1 | {
"split": "train",
"row_index": 1891
} |
How many different services are provided by all stations? | SELECT COUNT(DISTINCT services) FROM station | CREATE TABLE station (services VARCHAR, id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 0 | 0 | 0 | {
"split": "train",
"row_index": 1895
} |
Find the origins from which more than 1 train starts. | SELECT origin FROM train GROUP BY origin HAVING COUNT(*) > 1 | CREATE TABLE train (origin VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1899
} |
How many professors are teaching class with code ACCT-211? | SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = 'ACCT-211' | CREATE TABLE CLASS (PROF_NUM VARCHAR(255), CRS_CODE VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1901
} |
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' | CREATE TABLE CLASS (PROF_NUM VARCHAR(255), id INTEGER PRIMARY KEY AUTO_INCREMENT); CREATE TABLE employee (EMP_NUM VARCHAR(255), EMP_LNAME VARCHAR(255), EMP_FNAME VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 2 | 0 | 0 | {
"split": "train",
"row_index": 1904
} |
What is the code of the school where the accounting department belongs to? | SELECT school_code FROM department WHERE dept_name = 'Accounting' | CREATE TABLE department (school_code VARCHAR(255), dept_name VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1905
} |
How many credits does course CIS-220 have, and what its description? | SELECT crs_credit, crs_description FROM course WHERE crs_code = 'CIS-220' | CREATE TABLE course (crs_credit VARCHAR(255), crs_description VARCHAR(255), crs_code VARCHAR(255)) | generic | medium | medium | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 1 | {
"split": "train",
"row_index": 1906
} |
what is the address of history department? | SELECT dept_address FROM department WHERE dept_name = 'History' | CREATE TABLE department (dept_address VARCHAR(255), dept_name VARCHAR(255)) | generic | easy | easy | classified | valid | valid | valid | [] | [] | [] | [] | [
"validated",
"extended",
"classified"
] | null | 1 | 0 | 0 | {
"split": "train",
"row_index": 1907
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.