richardr1126/spider-context-instruct huggingface dataset:
### Instruction:

Convert text to sql: How many assets can each parts be used in? List the part name and the number. | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select parts.part_name , count ( * ) from parts join asset_parts on parts.part_id = asset_parts.part_id group by parts.part_name
### Instruction:

Convert text to sql: What are all the fault descriptions and the fault status of all the faults recoreded in the logs? | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select fault_log.fault_description , fault_log_parts.fault_status from fault_log join fault_log_parts on fault_log.fault_log_entry_id = fault_log_parts.fault_log_entry_id
### Instruction:

Convert text to sql: How many engineer visits are required at most for a single fault log? List the number and the log entry id. | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select count ( * ) , fault_log.fault_log_entry_id from fault_log join engineer_visits on fault_log.fault_log_entry_id = engineer_visits.fault_log_entry_id group by fault_log.fault_log_entry_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What are all the distinct last names of all the engineers? | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select distinct last_name from maintenance_engineers
### Instruction:

Convert text to sql: How many fault status codes are recorded in the fault log parts table? | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select distinct fault_status from fault_log_parts
### Instruction:

Convert text to sql: Which engineers have never visited to maintain the assets? List the engineer first name and last name. | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select first_name , last_name from maintenance_engineers where engineer_id not in ( select engineer_id from engineer_visits )
### Instruction:

Convert text to sql: List the asset id, details, make and model for every asset. | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select asset_id , asset_details , asset_make , asset_model from assets
### Instruction:

Convert text to sql: When was the first asset acquired? | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select asset_acquired_date from assets order by asset_acquired_date asc limit 1
### Instruction:

Convert text to sql: Which part fault requires the most number of skills to fix? List part id and name. | 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_id , part_name , chargeable_yn , chargeable_amount , other_part_details | skills : skill_id , skill_code , skill_description | staff : staff_id , staff_name , gender , other_staff_details | assets : asset_id , maintenance_contract_id , supplier_company_id , asset_details , asset_make , asset_model , asset_acquired_date , asset_disposed_date , other_asset_details | asset_parts : asset_id , part_id | maintenance_engineers : engineer_id , company_id , first_name , last_name , other_details | engineer_skills : engineer_id , skill_id | fault_log : fault_log_entry_id , asset_id , recorded_by_staff_id , fault_log_entry_datetime , fault_description , other_fault_details | engineer_visits : engineer_visit_id , contact_staff_id , engineer_id , fault_log_entry_id , fault_status , visit_start_datetime , visit_end_datetime , other_visit_details | part_faults : part_fault_id , part_id , fault_short_name , fault_description , other_fault_details | fault_log_parts : fault_log_entry_id , part_fault_id , fault_status | skills_required_to_fix : part_fault_id , skill_id | maintenance_contracts.maintenance_contract_company_id = third_party_companies.company_id | assets.supplier_company_id = third_party_companies.company_id | assets.maintenance_contract_id = maintenance_contracts.maintenance_contract_id | asset_parts.asset_id = assets.asset_id | asset_parts.part_id = parts.part_id | maintenance_engineers.company_id = third_party_companies.company_id | engineer_skills.skill_id = skills.skill_id | engineer_skills.engineer_id = maintenance_engineers.engineer_id | fault_log.recorded_by_staff_id = staff.staff_id | fault_log.asset_id = assets.asset_id | engineer_visits.contact_staff_id = staff.staff_id | engineer_visits.engineer_id = maintenance_engineers.engineer_id | engineer_visits.fault_log_entry_id = fault_log.fault_log_entry_id | part_faults.part_id = parts.part_id | fault_log_parts.fault_log_entry_id = fault_log.fault_log_entry_id | fault_log_parts.part_fault_id = part_faults.part_fault_id | skills_required_to_fix.skill_id = skills.skill_id | skills_required_to_fix.part_fault_id = part_faults.part_fault_id | 

### Response:

select parts.part_id , parts.part_name from parts join part_faults on parts.part_id = part_faults.part_id join skills_required_to_fix on part_faults.part_fault_id = skills_required_to_fix.part_fault_id group by parts.part_id order by count ( * ) desc limit 1