db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
behavior_monitoring | select * from assessment_notes order by date_of_notes asc | Question: list all information about the assessment notes sorted by date in ascending order. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses ->... | list all information about the assessment notes sorted by date in ascending order. |
behavior_monitoring | select city from addresses order by city | Question: list all cities of addresses in alphabetical order. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address_id, line_1, line_2, li... | list all cities of addresses in alphabetical order. |
behavior_monitoring | select first_name , last_name from teachers order by last_name | Question: find the first names and last names of teachers in alphabetical order of last name. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -... | find the first names and last names of teachers in alphabetical order of last name. |
behavior_monitoring | select * from student_addresses order by monthly_rental desc | Question: find all information about student addresses, and sort by monthly rental in descending order. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. A... | find all information about student addresses, and sort by monthly rental in descending order. |
behavior_monitoring | 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 | Question: find the id and first name of the student that has the most number of assessment notes? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Address... | find the id and first name of the student that has the most number of assessment notes? |
behavior_monitoring | 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 | Question: find the ids and first names of the 3 teachers that have the most number of assessment notes? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. A... | find the ids and first names of the 3 teachers that have the most number of assessment notes? |
behavior_monitoring | 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 | Question: find the id and last name of the student that has the most behavior incidents? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> add... | find the id and last name of the student that has the most behavior incidents? |
behavior_monitoring | 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 | Question: find the id and last name of the teacher that has the most detentions with detention type code 'after'? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_desc... | find the id and last name of the teacher that has the most detentions with detention type code 'after'? |
behavior_monitoring | 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 | Question: what are the id and first name of the student whose addresses have the highest average monthly rental? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_descr... | what are the id and first name of the student whose addresses have the highest average monthly rental? |
behavior_monitoring | 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 | Question: find the id and city of the student address with the highest average monthly rental. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses ... | find the id and city of the student address with the highest average monthly rental. |
behavior_monitoring | 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 | Question: what are the code and description of the most frequent behavior incident type? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> add... | what are the code and description of the most frequent behavior incident type? |
behavior_monitoring | 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 | Question: what are the code and description of the least frequent detention type ? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address_i... | what are the code and description of the least frequent detention type ? |
behavior_monitoring | 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' | Question: find the dates of assessment notes for students with first name 'fanny'. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address_i... | find the dates of assessment notes for students with first name 'fanny'. |
behavior_monitoring | 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' | Question: find the texts of assessment notes for teachers with last name 'schuster'. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address... | find the texts of assessment notes for teachers with last name 'schuster'. |
behavior_monitoring | 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' | Question: find the start and end dates of behavior incidents of students with last name 'fahey'. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresse... | find the start and end dates of behavior incidents of students with last name 'fahey'. |
behavior_monitoring | 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' | Question: find the start and end dates of detentions of teachers with last name 'schultz'. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> a... | find the start and end dates of detentions of teachers with last name 'schultz'. |
behavior_monitoring | 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 | Question: what are the id and zip code of the address with the highest monthly rental? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> addre... | what are the id and zip code of the address with the highest monthly rental? |
behavior_monitoring | 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 | Question: what is the cell phone number of the student whose address has the lowest monthly rental? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addre... | what is the cell phone number of the student whose address has the lowest monthly rental? |
behavior_monitoring | 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' | Question: what are the monthly rentals of student addresses in texas state? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address_id, line... | what are the monthly rentals of student addresses in texas state? |
behavior_monitoring | 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' | Question: what are the first names and last names of students with address in wisconsin state? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses ... | what are the first names and last names of students with address in wisconsin state? |
behavior_monitoring | 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 | Question: what are the line 1 and average monthly rentals of all student addresses? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address_... | what are the line 1 and average monthly rentals of all student addresses? |
behavior_monitoring | select t1.zip_postcode from addresses as t1 join teachers as t2 on t1.address_id = t2.address_id where t2.first_name = 'lyla' | Question: what is the zip code of the address where the teacher with first name 'lyla' lives? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -... | what is the zip code of the address where the teacher with first name 'lyla' lives? |
behavior_monitoring | select t2.email_address from addresses as t1 join teachers as t2 on t1.address_id = t2.address_id where t1.zip_postcode = '918' | Question: what are the email addresses of teachers whose address has zip code '918'? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address... | what are the email addresses of teachers whose address has zip code '918'? |
behavior_monitoring | select count(*) from students where student_id not in ( select student_id from behavior_incident ) | Question: how many students are not involved in any behavior incident? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address_id, line_1, l... | how many students are not involved in any behavior incident? |
behavior_monitoring | 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 | Question: find the last names of teachers who are not involved in any detention. | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> address_id,... | find the last names of teachers who are not involved in any detention. |
behavior_monitoring | 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 | Question: what are the line 1 of addresses shared by some students and some teachers? | Tables: Ref_Address_Types -> address_type_code, address_type_description. Ref_Detention_Type -> detention_type_code, detention_type_description. Ref_Incident_Type -> incident_type_code, incident_type_description. Addresses -> addres... | what are the line 1 of addresses shared by some students and some teachers? |
assets_maintenance | 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 | Question: which assets have 2 parts and have less than 2 fault logs? list the asset id and detail. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, co... | which assets have 2 parts and have less than 2 fault logs? list the asset id and detail. |
assets_maintenance | 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 | Question: how many assets does each maintenance contract contain? list the number and the contract id. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date... | how many assets does each maintenance contract contain? list the number and the contract id. |
assets_maintenance | 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 | Question: how many assets does each third party company supply? list the count and the company id. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, co... | how many assets does each third party company supply? list the count and the company id. |
assets_maintenance | 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 = ... | Question: which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? list the company id and name. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, mainten... | which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? list the company id and name. |
assets_maintenance | 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 | Question: what is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers? | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, co... | what is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers? |
assets_maintenance | 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 | Question: which engineer has visited the most times? show the engineer id, first name and last name. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, ... | which engineer has visited the most times? show the engineer id, first name and last name. |
assets_maintenance | 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 | Question: which parts have more than 2 faults? show the part name and id. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, other_co... | which parts have more than 2 faults? show the part name and id. |
assets_maintenance | 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 | Question: list all every engineer's first name, last name, details and coresponding skill description. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date... | list all every engineer's first name, last name, details and coresponding skill description. |
assets_maintenance | 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 | 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. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance... | 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. |
assets_maintenance | 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 | Question: how many assets can each parts be used in? list the part name and the number. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_... | how many assets can each parts be used in? list the part name and the number. |
assets_maintenance | 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 | Question: what are all the fault descriptions and the fault status of all the faults recoreded in the logs? | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start... | what are all the fault descriptions and the fault status of all the faults recoreded in the logs? |
assets_maintenance | 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 | Question: how many engineer visits are required at most for a single fault log? list the number and the log entry id. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, cont... | how many engineer visits are required at most for a single fault log? list the number and the log entry id. |
assets_maintenance | select distinct last_name from maintenance_engineers | Question: what are all the distinct last names of all the engineers? | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, other_contrac... | what are all the distinct last names of all the engineers? |
assets_maintenance | select distinct fault_status from fault_log_parts | Question: how many fault status codes are recorded in the fault log parts table? | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, o... | how many fault status codes are recorded in the fault log parts table? |
assets_maintenance | select first_name , last_name from maintenance_engineers where engineer_id not in (select engineer_id from engineer_visits) | Question: which engineers have never visited to maintain the assets? list the engineer first name and last name. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_... | which engineers have never visited to maintain the assets? list the engineer first name and last name. |
assets_maintenance | select asset_id , asset_details , asset_make , asset_model from assets | Question: list the asset id, details, make and model for every asset. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, other_contra... | list the asset id, details, make and model for every asset. |
assets_maintenance | select asset_acquired_date from assets order by asset_acquired_date asc limit 1 | Question: when was the first asset acquired? | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, other_contract_details. Parts -> part... | when was the first asset acquired? |
assets_maintenance | 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 | Question: which part fault requires the most number of skills to fix? list part id and name. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract... | which part fault requires the most number of skills to fix? list part id and name. |
assets_maintenance | 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 | Question: which kind of part has the least number of faults? list the part name. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, o... | which kind of part has the least number of faults? list the part name. |
assets_maintenance | 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 | Question: among those engineers who have visited, which engineer makes the least number of visits? list the engineer id, first name and last name. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintena... | among those engineers who have visited, which engineer makes the least number of visits? list the engineer id, first name and last name. |
assets_maintenance | 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 | Question: which staff have contacted which engineers? list the staff name and the engineer first name and last name. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contr... | which staff have contacted which engineers? list the staff name and the engineer first name and last name. |
assets_maintenance | 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 | Question: which fault log included the most number of faulty parts? list the fault log id, description and record time. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, co... | which fault log included the most number of faulty parts? list the fault log id, description and record time. |
assets_maintenance | 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 | Question: which skill is used in fixing the most number of faults? list the skill id and description. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date,... | which skill is used in fixing the most number of faults? list the skill id and description. |
assets_maintenance | select distinct asset_model from assets | Question: what are all the distinct asset models? | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, other_contract_details. Parts ->... | what are all the distinct asset models? |
assets_maintenance | select asset_make , asset_model , asset_details from assets order by asset_disposed_date asc | Question: list the all the assets make, model, details by the disposed date ascendingly. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end... | list the all the assets make, model, details by the disposed date ascendingly. |
assets_maintenance | select part_id , chargeable_amount from parts order by chargeable_amount asc limit 1 | Question: which part has the least chargeable amount? list the part id and amount. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date,... | which part has the least chargeable amount? list the part id and amount. |
assets_maintenance | 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 | Question: which company started the earliest the maintenance contract? show the company name. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contrac... | which company started the earliest the maintenance contract? show the company name. |
assets_maintenance | 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 | Question: what is the description of the type of the company who concluded its contracts most recently? | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_dat... | what is the description of the type of the company who concluded its contracts most recently? |
assets_maintenance | select gender from staff group by gender order by count(*) desc limit 1 | Question: which gender makes up the majority of the staff? | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, other_contract_details.... | which gender makes up the majority of the staff? |
assets_maintenance | 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 | Question: how many engineers did each staff contact? list both the contact staff name and number of engineers contacted. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, c... | how many engineers did each staff contact? list both the contact staff name and number of engineers contacted. |
assets_maintenance | select asset_model from assets where asset_id not in (select asset_id from fault_log) | Question: which assets did not incur any fault log? list the asset model. | Tables: Third_Party_Companies -> company_id, company_type, company_name, company_address, other_company_details. Maintenance_Contracts -> maintenance_contract_id, maintenance_contract_company_id, contract_start_date, contract_end_date, other_co... | which assets did not incur any fault log? list the asset model. |
station_weather | select local_authority , services from station | Question: list the local authorities and services provided by all stations. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_temperature,... | list the local authorities and services provided by all stations. |
station_weather | select train_number , name from train order by time | Question: show all train numbers and names ordered by their time from early to late. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_tem... | show all train numbers and names ordered by their time from early to late. |
station_weather | select time , train_number from train where destination = 'chennai' order by time | Question: give me the times and numbers of all trains that go to chennai, ordered by time. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, l... | give me the times and numbers of all trains that go to chennai, ordered by time. |
station_weather | select count(*) from train where name like '%express%' | Question: how many trains have 'express' in their names? | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_temperature, precipitation, win... | how many trains have 'express' in their names? |
station_weather | select train_number , time from train where origin = 'chennai' and destination = 'guruvayur' | Question: find the number and time of the train that goes from chennai to guruvayur. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_tem... | find the number and time of the train that goes from chennai to guruvayur. |
station_weather | select origin , count(*) from train group by origin | Question: find the number of trains starting from each origin. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_temperature, precipitatio... | find the number of trains starting from each origin. |
station_weather | 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 | Question: find the name of the train whose route runs through greatest number of stations. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, l... | find the name of the train whose route runs through greatest number of stations. |
station_weather | 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 | Question: find the number of trains for each station, as well as the station network name and services. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_t... | find the number of trains for each station, as well as the station network name and services. |
station_weather | select avg(high_temperature) , day_of_week from weekly_weather group by day_of_week | Question: what is the average high temperature for each day of week? | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_temperature, precip... | what is the average high temperature for each day of week? |
station_weather | 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' | Question: give me the maximum low temperature and average precipitation at the amersham station. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperat... | give me the maximum low temperature and average precipitation at the amersham station. |
station_weather | 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' | Question: find names and times of trains that run through stations for the local authority chiltern. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temp... | find names and times of trains that run through stations for the local authority chiltern. |
station_weather | select count(distinct services) from station | Question: how many different services are provided by all stations? | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_temperature, precipi... | how many different services are provided by all stations? |
station_weather | 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 | Question: find the id and local authority of the station with has the highest average high temperature. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_t... | find the id and local authority of the station with has the highest average high temperature. |
station_weather | 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 | Question: find the id and local authority of the station whose maximum precipitation is higher than 50. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_t... | find the id and local authority of the station whose maximum precipitation is higher than 50. |
station_weather | select min(low_temperature) , max(wind_speed_mph) from weekly_weather | Question: show the lowest low temperature and highest wind speed in miles per hour. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_temp... | show the lowest low temperature and highest wind speed in miles per hour. |
station_weather | select origin from train group by origin having count(*) > 1 | Question: find the origins from which more than 1 train starts. | Tables: train -> id, train_number, name, origin, destination, time, interval. station -> id, network_name, services, local_authority. route -> train_id, station_id. weekly_weather -> station_id, day_of_week, high_temperature, low_temperature, precipitati... | find the origins from which more than 1 train starts. |
college_1 | select count(*) from professor as t1 join department as t2 on t1.dept_code = t2.dept_code where dept_name = 'accounting' | Question: find the number of professors in accounting department. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_... | find the number of professors in accounting department. |
college_1 | select count(*) from professor as t1 join department as t2 on t1.dept_code = t2.dept_code where dept_name = 'accounting' | Question: how many professors are in the accounting dept? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP... | how many professors are in the accounting dept? |
college_1 | select count(distinct prof_num) from class where crs_code = 'acct-211' | Question: how many professors are teaching class with code acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> E... | how many professors are teaching class with code acct-211? |
college_1 | select count(distinct prof_num) from class where crs_code = 'acct-211' | Question: how many professors teach a class with the code acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EM... | how many professors teach a class with the code acct-211? |
college_1 | 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' | Question: what is the first and last name of the professor in biology department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. ... | what is the first and last name of the professor in biology department? |
college_1 | 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' | Question: what are the first and last name of all biology professors? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> ... | what are the first and last name of all biology professors? |
college_1 | 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' | Question: what are the first names and date of birth of professors teaching course acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_... | what are the first names and date of birth of professors teaching course acct-211? |
college_1 | 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' | Question: what are the first names and birthdates of the professors in charge of acct-211? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EX... | what are the first names and birthdates of the professors in charge of acct-211? |
college_1 | select count(*) from employee as t1 join class as t2 on t1.emp_num = t2.prof_num where t1.emp_lname = 'graztevski' | Question: how many classes are professor whose last name is graztevski has? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOY... | how many classes are professor whose last name is graztevski has? |
college_1 | select count(*) from employee as t1 join class as t2 on t1.emp_num = t2.prof_num where t1.emp_lname = 'graztevski' | Question: how many classes does the professor whose last name is graztevski teach? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION.... | how many classes does the professor whose last name is graztevski teach? |
college_1 | select school_code from department where dept_name = 'accounting' | Question: what is the code of the school where the accounting department belongs to? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSIO... | what is the code of the school where the accounting department belongs to? |
college_1 | select school_code from department where dept_name = 'accounting' | Question: what is the school code of the accounting department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NU... | what is the school code of the accounting department? |
college_1 | select crs_credit , crs_description from course where crs_code = 'cis-220' | Question: how many credits does course cis-220 have, and what its description? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMP... | how many credits does course cis-220 have, and what its description? |
college_1 | select crs_credit , crs_description from course where crs_code = 'cis-220' | Question: what is the description for the cis-220 and how many credits does it have? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSIO... | what is the description for the cis-220 and how many credits does it have? |
college_1 | select dept_address from department where dept_name = 'history' | Question: what is the address of history department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAM... | what is the address of history department? |
college_1 | select dept_address from department where dept_name = 'history' | Question: where is the history department? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, EMP_FNA... | where is the history department? |
college_1 | select count(distinct dept_address) from department where school_code = 'bus' | Question: how many different locations does the school with code bus has? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE... | how many different locations does the school with code bus has? |
college_1 | select count(distinct dept_address) from department where school_code = 'bus' | Question: what are the different locations of the school with the code bus? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOY... | what are the different locations of the school with the code bus? |
college_1 | select count(distinct dept_address) , school_code from department group by school_code | Question: how many different locations does each school have? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM,... | how many different locations does each school have? |
college_1 | select count(distinct dept_address) , school_code from department group by school_code | Question: count different addresses of each school. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME... | count different addresses of each school. |
college_1 | select crs_credit , crs_description from course where crs_code = 'qm-261' | Question: find the description and credit for the course qm-261? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_N... | find the description and credit for the course qm-261? |
college_1 | select crs_credit , crs_description from course where crs_code = 'qm-261' | Question: what is the course description and number of credits for qm-261? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYE... | what is the course description and number of credits for qm-261? |
college_1 | select count(distinct dept_name) , school_code from department group by school_code | Question: find the number of departments in each school. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_... | find the number of departments in each school. |
college_1 | select count(distinct dept_name) , school_code from department group by school_code | Question: how many departments are in each school? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME,... | how many departments are in each school? |
college_1 | select count(distinct dept_name) , school_code from department group by school_code having count(distinct dept_name) < 5 | Question: find the number of different departments in each school whose number of different departments is less than 5. | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, E... | find the number of different departments in each school whose number of different departments is less than 5. |
college_1 | select count(distinct dept_name) , school_code from department group by school_code having count(distinct dept_name) < 5 | Question: how many different departments are there in each school that has less than 5 apartments? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS,... | how many different departments are there in each school that has less than 5 apartments? |
college_1 | select count(*) , crs_code from class group by crs_code | Question: how many sections does each course has? | Tables: CLASS -> CLASS_CODE, CRS_CODE, CLASS_SECTION, CLASS_TIME, CLASS_ROOM, PROF_NUM. COURSE -> CRS_CODE, DEPT_CODE, CRS_DESCRIPTION, CRS_CREDIT. DEPARTMENT -> DEPT_CODE, DEPT_NAME, SCHOOL_CODE, EMP_NUM, DEPT_ADDRESS, DEPT_EXTENSION. EMPLOYEE -> EMP_NUM, EMP_LNAME, ... | how many sections does each course has? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.