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

Convert text to sql: What is the id of the product that is booked for 3 times? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select product_id from products_booked group by product_id having count ( * ) = 3

### Instruction:

Convert text to sql: What is the product description of the product booked with an amount of 102.76? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select products_for_hire.product_description from products_booked join products_for_hire on products_booked.product_id = products_for_hire.product_id where products_booked.booked_amount = 102.76
### Instruction:

Convert text to sql: What are the start date and end date of the booking that has booked the product named 'Book collection A'? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select bookings.booking_start_date , bookings.booking_end_date from products_for_hire join products_booked on products_for_hire.product_id = products_booked.product_id join bookings on products_booked.booking_id = bookings.booking_id where products_for_hire.product_name = 'Book collection A'
### Instruction:

Convert text to sql: What are the names of products whose availability equals to 1? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select products_for_hire.product_name from view_product_availability join products_for_hire on view_product_availability.product_id = products_for_hire.product_id where view_product_availability.available_yn = 1

### Instruction:

Convert text to sql: How many different product types are there? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select count ( distinct product_type_code ) from products_for_hire
### Instruction:

Convert text to sql: What are the first name, last name, and gender of all the good customers? Order by their last name. | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select first_name , last_name , gender_mf from customers where good_or_bad_customer = 'good' order by last_name asc

### Instruction:

Convert text to sql: What is the average amount due for all the payments? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select avg ( amount_due ) from payments
### Instruction:

Convert text to sql: What are the maximum, minimum, and average booked count for the products booked? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select max ( booked_count ) , min ( booked_count ) , avg ( booked_count ) from products_booked

### Instruction:

Convert text to sql: What are all the distinct payment types? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select distinct payment_type_code from payments
### Instruction:

Convert text to sql: What are the daily hire costs for the products with substring 'Book' in its name? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select daily_hire_cost from products_for_hire where product_name like '%Book%'

### Instruction:

Convert text to sql: How many products are never booked with amount higher than 200? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select count ( * ) from products_for_hire where product_id not in ( select product_id from products_booked where booked_amount > 200 )
### Instruction:

Convert text to sql: What are the coupon amount of the coupons owned by both good and bad customers? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select discount_coupons.coupon_amount from discount_coupons join customers on discount_coupons.coupon_id = customers.coupon_id where customers.good_or_bad_customer = 'good' intersect select discount_coupons.coupon_amount from discount_coupons join customers on discount_coupons.coupon_id = customers.coupon_id where customers.good_or_bad_customer = 'bad'
### Instruction:

Convert text to sql: What are the payment date of the payment with amount paid higher than 300 or with payment type is 'Check' | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select payment_date from payments where amount_paid > 300 or payment_type_code = 'Check'

### Instruction:

Convert text to sql: What are the names and descriptions of the products that are of 'Cutlery' type and have daily hire cost lower than 20? | discount_coupons : coupon_id , date_issued , coupon_amount | customers : customer_id , coupon_id , good_or_bad_customer , first_name , last_name , gender_mf , date_became_customer , date_last_hire | bookings : booking_id , customer_id , booking_status_code , returned_damaged_yn , booking_start_date , booking_end_date , count_hired , amount_payable , amount_of_discount , amount_outstanding , amount_of_refund | products_for_hire : product_id , product_type_code , daily_hire_cost , product_name , product_description | payments : payment_id , booking_id , customer_id , payment_type_code , amount_paid_in_full_yn , payment_date , amount_due , amount_paid | products_booked : booking_id , product_id , returned_yn , returned_late_yn , booked_count , booked_amount | view_product_availability : product_id , booking_id , status_date , available_yn | customers.coupon_id = discount_coupons.coupon_id | bookings.customer_id = customers.customer_id | payments.customer_id = customers.customer_id | payments.booking_id = bookings.booking_id | products_booked.product_id = products_for_hire.product_id | products_booked.booking_id = bookings.booking_id | view_product_availability.product_id = products_for_hire.product_id | view_product_availability.booking_id = bookings.booking_id | 

### Response:

select product_name , product_description from products_for_hire where product_type_code = 'Cutlery' and daily_hire_cost < 20