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

Convert text to sql: How many lessons taught by staff whose first name has letter 'a' in it? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select count ( * ) from lessons join staff on lessons.staff_id = staff.staff_id where staff.first_name like '%a%'

### Instruction:

Convert text to sql: How many lessons were taught by a staff member whose first name has the letter 'a' in it? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select count ( * ) from lessons join staff on lessons.staff_id = staff.staff_id where staff.first_name like '%a%'
### Instruction:

Convert text to sql: How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select sum ( lesson_time ) from lessons join staff on lessons.staff_id = staff.staff_id where staff.first_name = 'Janessa' and staff.last_name = 'Sawayn'

### Instruction:

Convert text to sql: What is the total time for all lessons taught by Janessa Sawayn? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select sum ( lesson_time ) from lessons join staff on lessons.staff_id = staff.staff_id where staff.first_name = 'Janessa' and staff.last_name = 'Sawayn'
### Instruction:

Convert text to sql: What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select avg ( price ) from lessons join staff on lessons.staff_id = staff.staff_id where staff.first_name = 'Janessa' and staff.last_name = 'Sawayn'

### Instruction:

Convert text to sql: What is the average price for a lesson taught by Janessa Sawayn? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select avg ( price ) from lessons join staff on lessons.staff_id = staff.staff_id where staff.first_name = 'Janessa' and staff.last_name = 'Sawayn'
### Instruction:

Convert text to sql: How many lesson does customer with first name Ray took? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select count ( * ) from lessons join customers on lessons.customer_id = customers.customer_id where customers.first_name = 'Ray'

### Instruction:

Convert text to sql: How many lessons did the customer with the first name Ray take? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select count ( * ) from lessons join customers on lessons.customer_id = customers.customer_id where customers.first_name = 'Ray'
### Instruction:

Convert text to sql: Which last names are both used by customers and by staff? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select last_name from customers intersect select last_name from staff

### Instruction:

Convert text to sql: What are the last names that are used by customers and staff? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select last_name from customers intersect select last_name from staff
### Instruction:

Convert text to sql: What is the first name of the staff who did not give any lesson? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select first_name from staff except select staff.first_name from lessons join staff on lessons.staff_id = staff.staff_id

### Instruction:

Convert text to sql: What is the first name of all employees who do not give any lessons? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select first_name from staff except select staff.first_name from lessons join staff on lessons.staff_id = staff.staff_id
### Instruction:

Convert text to sql: What is the id and detail of the vehicle used in lessons for most of the times? | addresses : address_id , line_1_number_building , city , zip_postcode , state_province_county , country | staff : staff_id , staff_address_id , nickname , first_name , middle_name , last_name , date_of_birth , date_joined_staff , date_left_staff | vehicles : vehicle_id , vehicle_details | customers : customer_id , customer_address_id , customer_status_code , date_became_customer , date_of_birth , first_name , last_name , amount_outstanding , email_address , phone_number , cell_mobile_phone_number | customer_payments : customer_id , datetime_payment , payment_method_code , amount_payment | lessons : lesson_id , customer_id , lesson_status_code , staff_id , vehicle_id , lesson_date , lesson_time , price | staff.staff_address_id = addresses.address_id | customers.customer_address_id = addresses.address_id | customer_payments.customer_id = customers.customer_id | lessons.customer_id = customers.customer_id | lessons.staff_id = staff.staff_id | lessons.vehicle_id = vehicles.vehicle_id | 

### Response:

select vehicles.vehicle_id , vehicles.vehicle_details from vehicles join lessons on vehicles.vehicle_id = lessons.vehicle_id group by vehicles.vehicle_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: How many faculty do we have? | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select count ( * ) from faculty

### Instruction:

Convert text to sql: What is the total number of faculty members? | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select count ( * ) from faculty

### Instruction:

Convert text to sql: What ranks do we have for faculty? | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select distinct rank from faculty

### Instruction:

Convert text to sql: Find the list of distinct ranks for faculty. | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select distinct rank from faculty

### Instruction:

Convert text to sql: Show all the distinct buildings that have faculty rooms. | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select distinct building from faculty
### Instruction:

Convert text to sql: What buildings have faculty offices? | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select distinct building from faculty

### Instruction:

Convert text to sql: Show the rank, first name, and last name for all the faculty. | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select rank , fname , lname from faculty

### Instruction:

Convert text to sql: What are the rank, first name, and last name of the faculty members? | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select rank , fname , lname from faculty

### Instruction:

Convert text to sql: Show the first name, last name, and phone number for all female faculty members. | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select fname , lname , phone from faculty where sex = 'F'

### Instruction:

Convert text to sql: What are the first name, last name, and phone number of all the female faculty members? | activity : actid , activity_name | participates_in : stuid , actid | faculty_participates_in : facid , actid | student : stuid , lname , fname , age , sex , major , advisor , city_code | faculty : facid , lname , fname , rank , sex , phone , room , building | participates_in.actid = activity.actid | participates_in.stuid = student.stuid | faculty_participates_in.actid = activity.actid | faculty_participates_in.facid = faculty.facid | 

### Response:

select fname , lname , phone from faculty where sex = 'F'