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

Convert text to sql: Which is the email of the party that has used the services the most number of times? | addresses : address_id , line_1_number_building , town_city , zip_postcode , state_province_county , country | services : service_id , service_type_code , service_name , service_descriptio | forms : form_id , form_type_code , service_id , form_number , form_name , form_description | individuals : individual_id , individual_first_name , individual_middle_name , inidividual_phone , individual_email , individual_address , individual_last_name | organizations : organization_id , date_formed , organization_name , uk_vat_number | parties : party_id , payment_method_code , party_phone , party_email | organization_contact_individuals : individual_id , organization_id , date_contact_from , date_contact_to | party_addresses : party_id , address_id , date_address_from , address_type_code , date_address_to | party_forms : party_id , form_id , date_completion_started , form_status_code , date_fully_completed | party_services : booking_id , customer_id , service_id , service_datetime , booking_made_date | forms.service_id = services.service_id | organization_contact_individuals.individual_id = individuals.individual_id | organization_contact_individuals.organization_id = organizations.organization_id | party_addresses.party_id = parties.party_id | party_addresses.address_id = addresses.address_id | party_forms.form_id = forms.form_id | party_forms.party_id = parties.party_id | party_services.customer_id = parties.party_id | party_services.service_id = services.service_id | 

### Response:

select parties.party_email from parties join party_services on parties.party_id = party_services.customer_id group by parties.party_email order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Return the party email that has used party services the greatest number of times. | addresses : address_id , line_1_number_building , town_city , zip_postcode , state_province_county , country | services : service_id , service_type_code , service_name , service_descriptio | forms : form_id , form_type_code , service_id , form_number , form_name , form_description | individuals : individual_id , individual_first_name , individual_middle_name , inidividual_phone , individual_email , individual_address , individual_last_name | organizations : organization_id , date_formed , organization_name , uk_vat_number | parties : party_id , payment_method_code , party_phone , party_email | organization_contact_individuals : individual_id , organization_id , date_contact_from , date_contact_to | party_addresses : party_id , address_id , date_address_from , address_type_code , date_address_to | party_forms : party_id , form_id , date_completion_started , form_status_code , date_fully_completed | party_services : booking_id , customer_id , service_id , service_datetime , booking_made_date | forms.service_id = services.service_id | organization_contact_individuals.individual_id = individuals.individual_id | organization_contact_individuals.organization_id = organizations.organization_id | party_addresses.party_id = parties.party_id | party_addresses.address_id = addresses.address_id | party_forms.form_id = forms.form_id | party_forms.party_id = parties.party_id | party_services.customer_id = parties.party_id | party_services.service_id = services.service_id | 

### Response:

select parties.party_email from parties join party_services on parties.party_id = party_services.customer_id group by parties.party_email order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Which state can address "6862 Kaitlyn Knolls" possibly be in? | addresses : address_id , line_1_number_building , town_city , zip_postcode , state_province_county , country | services : service_id , service_type_code , service_name , service_descriptio | forms : form_id , form_type_code , service_id , form_number , form_name , form_description | individuals : individual_id , individual_first_name , individual_middle_name , inidividual_phone , individual_email , individual_address , individual_last_name | organizations : organization_id , date_formed , organization_name , uk_vat_number | parties : party_id , payment_method_code , party_phone , party_email | organization_contact_individuals : individual_id , organization_id , date_contact_from , date_contact_to | party_addresses : party_id , address_id , date_address_from , address_type_code , date_address_to | party_forms : party_id , form_id , date_completion_started , form_status_code , date_fully_completed | party_services : booking_id , customer_id , service_id , service_datetime , booking_made_date | forms.service_id = services.service_id | organization_contact_individuals.individual_id = individuals.individual_id | organization_contact_individuals.organization_id = organizations.organization_id | party_addresses.party_id = parties.party_id | party_addresses.address_id = addresses.address_id | party_forms.form_id = forms.form_id | party_forms.party_id = parties.party_id | party_services.customer_id = parties.party_id | party_services.service_id = services.service_id | 

### Response:

select state_province_county from addresses where line_1_number_building like '%6862 Kaitlyn Knolls%'
### Instruction:

Convert text to sql: Give the state corresponding to the line number building "6862 Kaitlyn Knolls". | addresses : address_id , line_1_number_building , town_city , zip_postcode , state_province_county , country | services : service_id , service_type_code , service_name , service_descriptio | forms : form_id , form_type_code , service_id , form_number , form_name , form_description | individuals : individual_id , individual_first_name , individual_middle_name , inidividual_phone , individual_email , individual_address , individual_last_name | organizations : organization_id , date_formed , organization_name , uk_vat_number | parties : party_id , payment_method_code , party_phone , party_email | organization_contact_individuals : individual_id , organization_id , date_contact_from , date_contact_to | party_addresses : party_id , address_id , date_address_from , address_type_code , date_address_to | party_forms : party_id , form_id , date_completion_started , form_status_code , date_fully_completed | party_services : booking_id , customer_id , service_id , service_datetime , booking_made_date | forms.service_id = services.service_id | organization_contact_individuals.individual_id = individuals.individual_id | organization_contact_individuals.organization_id = organizations.organization_id | party_addresses.party_id = parties.party_id | party_addresses.address_id = addresses.address_id | party_forms.form_id = forms.form_id | party_forms.party_id = parties.party_id | party_services.customer_id = parties.party_id | party_services.service_id = services.service_id | 

### Response:

select state_province_county from addresses where line_1_number_building like '%6862 Kaitlyn Knolls%'
### Instruction:

Convert text to sql: What is the name of organization that has the greatest number of contact individuals? | addresses : address_id , line_1_number_building , town_city , zip_postcode , state_province_county , country | services : service_id , service_type_code , service_name , service_descriptio | forms : form_id , form_type_code , service_id , form_number , form_name , form_description | individuals : individual_id , individual_first_name , individual_middle_name , inidividual_phone , individual_email , individual_address , individual_last_name | organizations : organization_id , date_formed , organization_name , uk_vat_number | parties : party_id , payment_method_code , party_phone , party_email | organization_contact_individuals : individual_id , organization_id , date_contact_from , date_contact_to | party_addresses : party_id , address_id , date_address_from , address_type_code , date_address_to | party_forms : party_id , form_id , date_completion_started , form_status_code , date_fully_completed | party_services : booking_id , customer_id , service_id , service_datetime , booking_made_date | forms.service_id = services.service_id | organization_contact_individuals.individual_id = individuals.individual_id | organization_contact_individuals.organization_id = organizations.organization_id | party_addresses.party_id = parties.party_id | party_addresses.address_id = addresses.address_id | party_forms.form_id = forms.form_id | party_forms.party_id = parties.party_id | party_services.customer_id = parties.party_id | party_services.service_id = services.service_id | 

### Response:

select organizations.organization_name from organizations join organization_contact_individuals on organizations.organization_id = organization_contact_individuals.organization_id group by organizations.organization_name order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Return the name of the organization which has the most contact individuals. | addresses : address_id , line_1_number_building , town_city , zip_postcode , state_province_county , country | services : service_id , service_type_code , service_name , service_descriptio | forms : form_id , form_type_code , service_id , form_number , form_name , form_description | individuals : individual_id , individual_first_name , individual_middle_name , inidividual_phone , individual_email , individual_address , individual_last_name | organizations : organization_id , date_formed , organization_name , uk_vat_number | parties : party_id , payment_method_code , party_phone , party_email | organization_contact_individuals : individual_id , organization_id , date_contact_from , date_contact_to | party_addresses : party_id , address_id , date_address_from , address_type_code , date_address_to | party_forms : party_id , form_id , date_completion_started , form_status_code , date_fully_completed | party_services : booking_id , customer_id , service_id , service_datetime , booking_made_date | forms.service_id = services.service_id | organization_contact_individuals.individual_id = individuals.individual_id | organization_contact_individuals.organization_id = organizations.organization_id | party_addresses.party_id = parties.party_id | party_addresses.address_id = addresses.address_id | party_forms.form_id = forms.form_id | party_forms.party_id = parties.party_id | party_services.customer_id = parties.party_id | party_services.service_id = services.service_id | 

### Response:

select organizations.organization_name from organizations join organization_contact_individuals on organizations.organization_id = organization_contact_individuals.organization_id group by organizations.organization_name order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Find the last name of the individuals that have been contact individuals of an organization. | addresses : address_id , line_1_number_building , town_city , zip_postcode , state_province_county , country | services : service_id , service_type_code , service_name , service_descriptio | forms : form_id , form_type_code , service_id , form_number , form_name , form_description | individuals : individual_id , individual_first_name , individual_middle_name , inidividual_phone , individual_email , individual_address , individual_last_name | organizations : organization_id , date_formed , organization_name , uk_vat_number | parties : party_id , payment_method_code , party_phone , party_email | organization_contact_individuals : individual_id , organization_id , date_contact_from , date_contact_to | party_addresses : party_id , address_id , date_address_from , address_type_code , date_address_to | party_forms : party_id , form_id , date_completion_started , form_status_code , date_fully_completed | party_services : booking_id , customer_id , service_id , service_datetime , booking_made_date | forms.service_id = services.service_id | organization_contact_individuals.individual_id = individuals.individual_id | organization_contact_individuals.organization_id = organizations.organization_id | party_addresses.party_id = parties.party_id | party_addresses.address_id = addresses.address_id | party_forms.form_id = forms.form_id | party_forms.party_id = parties.party_id | party_services.customer_id = parties.party_id | party_services.service_id = services.service_id | 

### Response:

select distinct individuals.individual_last_name from individuals join organization_contact_individuals on individuals.individual_id = organization_contact_individuals.individual_id
### Instruction:

Convert text to sql: What are the last names of individuals who have been contact individuals for an organization? | addresses : address_id , line_1_number_building , town_city , zip_postcode , state_province_county , country | services : service_id , service_type_code , service_name , service_descriptio | forms : form_id , form_type_code , service_id , form_number , form_name , form_description | individuals : individual_id , individual_first_name , individual_middle_name , inidividual_phone , individual_email , individual_address , individual_last_name | organizations : organization_id , date_formed , organization_name , uk_vat_number | parties : party_id , payment_method_code , party_phone , party_email | organization_contact_individuals : individual_id , organization_id , date_contact_from , date_contact_to | party_addresses : party_id , address_id , date_address_from , address_type_code , date_address_to | party_forms : party_id , form_id , date_completion_started , form_status_code , date_fully_completed | party_services : booking_id , customer_id , service_id , service_datetime , booking_made_date | forms.service_id = services.service_id | organization_contact_individuals.individual_id = individuals.individual_id | organization_contact_individuals.organization_id = organizations.organization_id | party_addresses.party_id = parties.party_id | party_addresses.address_id = addresses.address_id | party_forms.form_id = forms.form_id | party_forms.party_id = parties.party_id | party_services.customer_id = parties.party_id | party_services.service_id = services.service_id | 

### Response:

select distinct individuals.individual_last_name from individuals join organization_contact_individuals on individuals.individual_id = organization_contact_individuals.individual_id
### Instruction:

Convert text to sql: How many drivers are there? | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select count ( * ) from driver

### Instruction:

Convert text to sql: Show the name, home city, and age for all drivers. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select name , home_city , age from driver

### Instruction:

Convert text to sql: Show the party and the number of drivers in each party. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select party , count ( * ) from driver group by party

### Instruction:

Convert text to sql: Show the name of drivers in descending order of age. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select name from driver order by age desc

### Instruction:

Convert text to sql: Show all different home cities. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select distinct home_city from driver

### Instruction:

Convert text to sql: Show the home city with the most number of drivers. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select home_city from driver group by home_city order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show the party with drivers from Hartford and drivers older than 40. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select party from driver where home_city = 'Hartford' and age > 40
### Instruction:

Convert text to sql: Show home city where at least two drivers older than 40 are from. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select home_city from driver where age > 40 group by home_city having count ( * ) >= 2

### Instruction:

Convert text to sql: Show all home cities except for those having a driver older than 40. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select home_city from driver except select home_city from driver where age > 40

### Instruction:

Convert text to sql: Show the names of the drivers without a school bus. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select name from driver where driver_id not in ( select driver_id from school_bus )

### Instruction:

Convert text to sql: Show the types of schools that have two schools. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select type from school group by type having count ( * ) = 2

### Instruction:

Convert text to sql: Show the school name and driver name for all school buses. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select school.school , driver.name from school_bus join school on school_bus.school_id = school.school_id join driver on school_bus.driver_id = driver.driver_id

### Instruction:

Convert text to sql: What is the maximum, minimum and average years spent working on a school bus? | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select max ( years_working ) , min ( years_working ) , avg ( years_working ) from school_bus
### Instruction:

Convert text to sql: Show the school name and type for schools without a school bus. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select school , type from school where school_id not in ( select school_id from school_bus )

### Instruction:

Convert text to sql: Show the type of school and the number of buses for each type. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select school.type , count ( * ) from school_bus join school on school_bus.school_id = school.school_id group by school.type

### Instruction:

Convert text to sql: How many drivers are from Hartford city or younger than 40? | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select count ( * ) from driver where home_city = 'Hartford' or age < 40

### Instruction:

Convert text to sql: List names for drivers from Hartford city and younger than 40. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select name from driver where home_city = 'Hartford' and age < 40

### Instruction:

Convert text to sql: find the name of driver who is driving the school bus with the longest working history. | driver : driver_id , name , party , home_city , age | school : school_id , grade , school , location , type | school_bus : school_id , driver_id , years_working , if_full_time | school_bus.driver_id = driver.driver_id | school_bus.school_id = school.school_id | 

### Response:

select driver.name from driver join school_bus on driver.driver_id = school_bus.driver_id order by years_working desc limit 1