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

Convert text to sql: What are the register ids of electoral registries that have the cross reference source system code 'Electoral' or 'Tax'? | customer_master_index : master_customer_id , cmi_details | cmi_cross_references : cmi_cross_ref_id , master_customer_id , source_system_code | council_tax : council_tax_id , cmi_cross_ref_id | business_rates : business_rates_id , cmi_cross_ref_id | benefits_overpayments : council_tax_id , cmi_cross_ref_id | parking_fines : council_tax_id , cmi_cross_ref_id | rent_arrears : council_tax_id , cmi_cross_ref_id | electoral_register : electoral_register_id , cmi_cross_ref_id | cmi_cross_references.master_customer_id = customer_master_index.master_customer_id | council_tax.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | business_rates.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | benefits_overpayments.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | parking_fines.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | rent_arrears.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | 

### Response:

select electoral_register.electoral_register_id from electoral_register join cmi_cross_references on electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id where cmi_cross_references.source_system_code = 'Electoral' or cmi_cross_references.source_system_code = 'Tax'

### Instruction:

Convert text to sql: How many different source system code for the cmi cross references are there? | customer_master_index : master_customer_id , cmi_details | cmi_cross_references : cmi_cross_ref_id , master_customer_id , source_system_code | council_tax : council_tax_id , cmi_cross_ref_id | business_rates : business_rates_id , cmi_cross_ref_id | benefits_overpayments : council_tax_id , cmi_cross_ref_id | parking_fines : council_tax_id , cmi_cross_ref_id | rent_arrears : council_tax_id , cmi_cross_ref_id | electoral_register : electoral_register_id , cmi_cross_ref_id | cmi_cross_references.master_customer_id = customer_master_index.master_customer_id | council_tax.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | business_rates.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | benefits_overpayments.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | parking_fines.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | rent_arrears.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | 

### Response:

select count ( distinct source_system_code ) from cmi_cross_references
### Instruction:

Convert text to sql: List all information about customer master index, and sort them by details in descending order. | customer_master_index : master_customer_id , cmi_details | cmi_cross_references : cmi_cross_ref_id , master_customer_id , source_system_code | council_tax : council_tax_id , cmi_cross_ref_id | business_rates : business_rates_id , cmi_cross_ref_id | benefits_overpayments : council_tax_id , cmi_cross_ref_id | parking_fines : council_tax_id , cmi_cross_ref_id | rent_arrears : council_tax_id , cmi_cross_ref_id | electoral_register : electoral_register_id , cmi_cross_ref_id | cmi_cross_references.master_customer_id = customer_master_index.master_customer_id | council_tax.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | business_rates.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | benefits_overpayments.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | parking_fines.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | rent_arrears.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | 

### Response:

select * from customer_master_index order by cmi_details desc

### Instruction:

Convert text to sql: List the council tax ids and their related cmi cross references of all the parking fines. | customer_master_index : master_customer_id , cmi_details | cmi_cross_references : cmi_cross_ref_id , master_customer_id , source_system_code | council_tax : council_tax_id , cmi_cross_ref_id | business_rates : business_rates_id , cmi_cross_ref_id | benefits_overpayments : council_tax_id , cmi_cross_ref_id | parking_fines : council_tax_id , cmi_cross_ref_id | rent_arrears : council_tax_id , cmi_cross_ref_id | electoral_register : electoral_register_id , cmi_cross_ref_id | cmi_cross_references.master_customer_id = customer_master_index.master_customer_id | council_tax.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | business_rates.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | benefits_overpayments.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | parking_fines.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | rent_arrears.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | 

### Response:

select council_tax_id , cmi_cross_ref_id from parking_fines
### Instruction:

Convert text to sql: How many council taxes are collected for renting arrears ? | customer_master_index : master_customer_id , cmi_details | cmi_cross_references : cmi_cross_ref_id , master_customer_id , source_system_code | council_tax : council_tax_id , cmi_cross_ref_id | business_rates : business_rates_id , cmi_cross_ref_id | benefits_overpayments : council_tax_id , cmi_cross_ref_id | parking_fines : council_tax_id , cmi_cross_ref_id | rent_arrears : council_tax_id , cmi_cross_ref_id | electoral_register : electoral_register_id , cmi_cross_ref_id | cmi_cross_references.master_customer_id = customer_master_index.master_customer_id | council_tax.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | business_rates.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | benefits_overpayments.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | parking_fines.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | rent_arrears.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | 

### Response:

select count ( * ) from rent_arrears

### Instruction:

Convert text to sql: What are the distinct cross reference source system codes which are related to the master customer details 'Gottlieb, Becker and Wyman'? | customer_master_index : master_customer_id , cmi_details | cmi_cross_references : cmi_cross_ref_id , master_customer_id , source_system_code | council_tax : council_tax_id , cmi_cross_ref_id | business_rates : business_rates_id , cmi_cross_ref_id | benefits_overpayments : council_tax_id , cmi_cross_ref_id | parking_fines : council_tax_id , cmi_cross_ref_id | rent_arrears : council_tax_id , cmi_cross_ref_id | electoral_register : electoral_register_id , cmi_cross_ref_id | cmi_cross_references.master_customer_id = customer_master_index.master_customer_id | council_tax.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | business_rates.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | benefits_overpayments.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | parking_fines.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | rent_arrears.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | 

### Response:

select distinct cmi_cross_references.source_system_code from customer_master_index join cmi_cross_references on customer_master_index.master_customer_id = cmi_cross_references.master_customer_id where customer_master_index.cmi_details = 'Gottlieb ,  Becker and Wyman'
### Instruction:

Convert text to sql: Which cmi cross reference id is not related to any parking taxes? | customer_master_index : master_customer_id , cmi_details | cmi_cross_references : cmi_cross_ref_id , master_customer_id , source_system_code | council_tax : council_tax_id , cmi_cross_ref_id | business_rates : business_rates_id , cmi_cross_ref_id | benefits_overpayments : council_tax_id , cmi_cross_ref_id | parking_fines : council_tax_id , cmi_cross_ref_id | rent_arrears : council_tax_id , cmi_cross_ref_id | electoral_register : electoral_register_id , cmi_cross_ref_id | cmi_cross_references.master_customer_id = customer_master_index.master_customer_id | council_tax.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | business_rates.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | benefits_overpayments.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | parking_fines.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | rent_arrears.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | 

### Response:

select cmi_cross_ref_id from cmi_cross_references except select cmi_cross_ref_id from parking_fines

### Instruction:

Convert text to sql: Which distinct source system code includes the substring 'en'? | customer_master_index : master_customer_id , cmi_details | cmi_cross_references : cmi_cross_ref_id , master_customer_id , source_system_code | council_tax : council_tax_id , cmi_cross_ref_id | business_rates : business_rates_id , cmi_cross_ref_id | benefits_overpayments : council_tax_id , cmi_cross_ref_id | parking_fines : council_tax_id , cmi_cross_ref_id | rent_arrears : council_tax_id , cmi_cross_ref_id | electoral_register : electoral_register_id , cmi_cross_ref_id | cmi_cross_references.master_customer_id = customer_master_index.master_customer_id | council_tax.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | business_rates.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | benefits_overpayments.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | parking_fines.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | rent_arrears.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | electoral_register.cmi_cross_ref_id = cmi_cross_references.cmi_cross_ref_id | 

### Response:

select distinct source_system_code from cmi_cross_references where source_system_code like '%en%'
### Instruction:

Convert text to sql: How many parties are there? | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select count ( * ) from party

### Instruction:

Convert text to sql: Count the number of parties. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select count ( * ) from party

### Instruction:

Convert text to sql: List the themes of parties in ascending order of number of hosts. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party_theme from party order by number_of_hosts asc

### Instruction:

Convert text to sql: What are the themes of parties ordered by the number of hosts in ascending manner? | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party_theme from party order by number_of_hosts asc

### Instruction:

Convert text to sql: What are the themes and locations of parties? | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party_theme , location from party

### Instruction:

Convert text to sql: Give me the theme and location of each party. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party_theme , location from party

### Instruction:

Convert text to sql: Show the first year and last year of parties with theme "Spring" or "Teqnology". | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select first_year , last_year from party where party_theme = 'Spring' or party_theme = 'Teqnology'
### Instruction:

Convert text to sql: What are the first year and last year of the parties whose theme is "Spring" or "Teqnology"? | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select first_year , last_year from party where party_theme = 'Spring' or party_theme = 'Teqnology'

### Instruction:

Convert text to sql: What is the average number of hosts for parties? | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select avg ( number_of_hosts ) from party

### Instruction:

Convert text to sql: Compute the average number of hosts for parties. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select avg ( number_of_hosts ) from party

### Instruction:

Convert text to sql: What is the location of the party with the most hosts? | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select location from party order by number_of_hosts desc limit 1

### Instruction:

Convert text to sql: Which party had the most hosts? Give me the party location. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select location from party order by number_of_hosts desc limit 1

### Instruction:

Convert text to sql: Show different nationalities along with the number of hosts of each nationality. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select nationality , count ( * ) from host group by nationality

### Instruction:

Convert text to sql: How many hosts does each nationality have? List the nationality and the count. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select nationality , count ( * ) from host group by nationality
### Instruction:

Convert text to sql: Show the most common nationality of hosts. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select nationality from host group by nationality order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which nationality has the most hosts? | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select nationality from host group by nationality order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show the nations that have both hosts older than 45 and hosts younger than 35. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select nationality from host where age > 45 intersect select nationality from host where age < 35

### Instruction:

Convert text to sql: Which nations have both hosts of age above 45 and hosts of age below 35? | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select nationality from host where age > 45 intersect select nationality from host where age < 35

### Instruction:

Convert text to sql: Show the themes of parties and the names of the party hosts. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party.party_theme , host.name from party_host join host on party_host.host_id = host.host_id join party on party_host.party_id = party.party_id

### Instruction:

Convert text to sql: For each party, return its theme and the name of its host. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party.party_theme , host.name from party_host join host on party_host.host_id = host.host_id join party on party_host.party_id = party.party_id
### Instruction:

Convert text to sql: Show the locations of parties and the names of the party hosts in ascending order of the age of the host. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party.location , host.name from party_host join host on party_host.host_id = host.host_id join party on party_host.party_id = party.party_id order by host.age asc

### Instruction:

Convert text to sql: For each party, find its location and the name of its host. Sort the result in ascending order of the age of the host. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party.location , host.name from party_host join host on party_host.host_id = host.host_id join party on party_host.party_id = party.party_id order by host.age asc

### Instruction:

Convert text to sql: Show the locations of parties with hosts older than 50. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party.location from party_host join host on party_host.host_id = host.host_id join party on party_host.party_id = party.party_id where host.age > 50

### Instruction:

Convert text to sql: Which parties have hosts of age above 50? Give me the party locations. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select party.location from party_host join host on party_host.host_id = host.host_id join party on party_host.party_id = party.party_id where host.age > 50

### Instruction:

Convert text to sql: Show the host names for parties with number of hosts greater than 20. | party : party_id , party_theme , location , first_year , last_year , number_of_hosts | host : host_id , name , nationality , age | party_host : party_id , host_id , is_main_in_charge | party_host.party_id = party.party_id | party_host.host_id = host.host_id | 

### Response:

select host.name from party_host join host on party_host.host_id = host.host_id join party on party_host.party_id = party.party_id where party.number_of_hosts > 20