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

Convert text to sql: Which city has the most addresses? List the city name, number of addresses, and city id. | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select city.city , count ( * ) , address.city_id from address join city on address.city_id = city.city_id group by address.city_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What are the city name, id, and number of addresses corresponding to the city with the most addressed? | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select city.city , count ( * ) , address.city_id from address join city on address.city_id = city.city_id group by address.city_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: How many addresses are in the district of California? | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select count ( * ) from address where district = 'California'
### Instruction:

Convert text to sql: Count the number of addressed in the California district. | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select count ( * ) from address where district = 'California'
### Instruction:

Convert text to sql: Which film is rented at a fee of 0.99 and has less than 3 in the inventory? List the film title and id. | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select title , film_id from film where rental_rate = 0.99 intersect select film.title , film.film_id from film join inventory on film.film_id = inventory.film_id group by film.film_id having count ( * ) < 3
### Instruction:

Convert text to sql: What are the title and id of the film which has a rental rate of 0.99 and an inventory of below 3? | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select title , film_id from film where rental_rate = 0.99 intersect select film.title , film.film_id from film join inventory on film.film_id = inventory.film_id group by film.film_id having count ( * ) < 3
### Instruction:

Convert text to sql: How many cities are in Australia? | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select count ( * ) from city join country on city.country_id = country.country_id where country.country = 'Australia'
### Instruction:

Convert text to sql: Count the number of cities in Australia. | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select count ( * ) from city join country on city.country_id = country.country_id where country.country = 'Australia'
### Instruction:

Convert text to sql: Which countries have at least 3 cities? | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select country.country from city join country on city.country_id = country.country_id group by country.country_id having count ( * ) >= 3
### Instruction:

Convert text to sql: What are the countries that contain 3 or more cities? | actor : actor_id , first_name , last_name , last_update | address : address_id , address , address2 , district , city_id , postal_code , phone , last_update | category : category_id , name , last_update | city : city_id , city , country_id , last_update | country : country_id , country , last_update | customer : customer_id , store_id , first_name , last_name , email , address_id , active , create_date , last_update | film : film_id , title , description , release_year , language_id , original_language_id , rental_duration , rental_rate , length , replacement_cost , rating , special_features , last_update | film_actor : actor_id , film_id , last_update | film_category : film_id , category_id , last_update | film_text : film_id , title , description | inventory : inventory_id , film_id , store_id , last_update | language : language_id , name , last_update | payment : payment_id , customer_id , staff_id , rental_id , amount , payment_date , last_update | rental : rental_id , rental_date , inventory_id , customer_id , return_date , staff_id , last_update | staff : staff_id , first_name , last_name , address_id , picture , email , store_id , active , username , password , last_update | store : store_id , manager_staff_id , address_id , last_update | address.city_id = city.city_id | city.country_id = country.country_id | customer.store_id = store.store_id | customer.address_id = address.address_id | film.original_language_id = language.language_id | film.language_id = language.language_id | film_actor.film_id = film.film_id | film_actor.actor_id = actor.actor_id | film_category.category_id = category.category_id | film_category.film_id = film.film_id | inventory.film_id = film.film_id | inventory.store_id = store.store_id | payment.staff_id = staff.staff_id | payment.customer_id = customer.customer_id | payment.rental_id = rental.rental_id | rental.customer_id = customer.customer_id | rental.inventory_id = inventory.inventory_id | rental.staff_id = staff.staff_id | staff.address_id = address.address_id | store.address_id = address.address_id | store.manager_staff_id = staff.staff_id | 

### Response:

select country.country from city join country on city.country_id = country.country_id group by country.country_id having count ( * ) >= 3