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

Convert text to sql: Show the official names of the cities that have hosted more than one competition. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select city.official_name from city join farm_competition on city.city_id = farm_competition.host_city_id group by farm_competition.host_city_id having count ( * ) > 1

### Instruction:

Convert text to sql: What are the official names of cities that have hosted more than one competition? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select city.official_name from city join farm_competition on city.city_id = farm_competition.host_city_id group by farm_competition.host_city_id having count ( * ) > 1

### Instruction:

Convert text to sql: Show the status of the city that has hosted the greatest number of competitions. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select city.status from city join farm_competition on city.city_id = farm_competition.host_city_id group by farm_competition.host_city_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the status of the city that has hosted the most competitions? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

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

Convert text to sql: Please show the themes of competitions with host cities having populations larger than 1000. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select farm_competition.theme from city join farm_competition on city.city_id = farm_competition.host_city_id where city.population > 1000

### Instruction:

Convert text to sql: What are the themes of competitions that have corresponding host cities with more than 1000 residents? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select farm_competition.theme from city join farm_competition on city.city_id = farm_competition.host_city_id where city.population > 1000

### Instruction:

Convert text to sql: Please show the different statuses of cities and the average population of cities with each status. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select status , avg ( population ) from city group by status

### Instruction:

Convert text to sql: What are the statuses and average populations of each city? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select status , avg ( population ) from city group by status
### Instruction:

Convert text to sql: Please show the different statuses, ordered by the number of cities that have each. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select status from city group by status order by count ( * ) asc

### Instruction:

Convert text to sql: Return the different statuses of cities, ascending by frequency. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select status from city group by status order by count ( * ) asc

### Instruction:

Convert text to sql: List the most common type of Status across cities. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select status from city group by status order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the most common status across all cities? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select status from city group by status order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: List the official names of cities that have not held any competition. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select official_name from city where city_id not in ( select host_city_id from farm_competition )

### Instruction:

Convert text to sql: What are the official names of cities that have not hosted a farm competition? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select official_name from city where city_id not in ( select host_city_id from farm_competition )

### Instruction:

Convert text to sql: Show the status shared by cities with population bigger than 1500 and smaller than 500. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select status from city where population > 1500 intersect select status from city where population < 500

### Instruction:

Convert text to sql: Which statuses correspond to both cities that have a population over 1500 and cities that have a population lower than 500? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select status from city where population > 1500 intersect select status from city where population < 500
### Instruction:

Convert text to sql: Find the official names of cities with population bigger than 1500 or smaller than 500. | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select official_name from city where population > 1500 or population < 500

### Instruction:

Convert text to sql: What are the official names of cities that have population over 1500 or less than 500? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select official_name from city where population > 1500 or population < 500

### Instruction:

Convert text to sql: Show the census ranking of cities whose status are not "Village". | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select census_ranking from city where status != 'Village'

### Instruction:

Convert text to sql: What are the census rankings of cities that do not have the status "Village"? | city : city_id , official_name , status , area_km_2 , population , census_ranking | farm : farm_id , year , total_horses , working_horses , total_cattle , oxen , bulls , cows , pigs , sheep_and_goats | farm_competition : competition_id , year , theme , host_city_id , hosts | competition_record : competition_id , farm_id , rank | farm_competition.host_city_id = city.city_id | competition_record.farm_id = farm.farm_id | competition_record.competition_id = farm_competition.competition_id | 

### Response:

select census_ranking from city where status != 'Village'
### Instruction:

Convert text to sql: which course has most number of registered students? | addresses : address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country | people : person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password | students : student_id , student_details | courses : course_id , course_name , course_description , other_details | people_addresses : person_address_id , person_id , address_id , date_from , date_to | student_course_registrations : student_id , course_id , registration_date | student_course_attendance : student_id , course_id , date_of_attendance | candidates : candidate_id , candidate_details | candidate_assessments : candidate_id , qualification , assessment_date , asessment_outcome_code | students.student_id = people.person_id | people_addresses.address_id = addresses.address_id | people_addresses.person_id = people.person_id | student_course_registrations.course_id = courses.course_id | student_course_registrations.student_id = students.student_id | student_course_attendance.student_id = student_course_registrations.student_id | student_course_attendance.course_id = student_course_registrations.course_id | candidates.candidate_id = people.person_id | candidate_assessments.candidate_id = candidates.candidate_id | 

### Response:

select courses.course_name from courses join student_course_registrations on courses.course_id = student_course_registrations.course_id group by courses.course_id order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the name of the course with the most registered students? | addresses : address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country | people : person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password | students : student_id , student_details | courses : course_id , course_name , course_description , other_details | people_addresses : person_address_id , person_id , address_id , date_from , date_to | student_course_registrations : student_id , course_id , registration_date | student_course_attendance : student_id , course_id , date_of_attendance | candidates : candidate_id , candidate_details | candidate_assessments : candidate_id , qualification , assessment_date , asessment_outcome_code | students.student_id = people.person_id | people_addresses.address_id = addresses.address_id | people_addresses.person_id = people.person_id | student_course_registrations.course_id = courses.course_id | student_course_registrations.student_id = students.student_id | student_course_attendance.student_id = student_course_registrations.student_id | student_course_attendance.course_id = student_course_registrations.course_id | candidates.candidate_id = people.person_id | candidate_assessments.candidate_id = candidates.candidate_id | 

### Response:

select courses.course_name from courses join student_course_registrations on courses.course_id = student_course_registrations.course_id group by courses.course_id order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: what is id of students who registered some courses but the least number of courses in these students? | addresses : address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country | people : person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password | students : student_id , student_details | courses : course_id , course_name , course_description , other_details | people_addresses : person_address_id , person_id , address_id , date_from , date_to | student_course_registrations : student_id , course_id , registration_date | student_course_attendance : student_id , course_id , date_of_attendance | candidates : candidate_id , candidate_details | candidate_assessments : candidate_id , qualification , assessment_date , asessment_outcome_code | students.student_id = people.person_id | people_addresses.address_id = addresses.address_id | people_addresses.person_id = people.person_id | student_course_registrations.course_id = courses.course_id | student_course_registrations.student_id = students.student_id | student_course_attendance.student_id = student_course_registrations.student_id | student_course_attendance.course_id = student_course_registrations.course_id | candidates.candidate_id = people.person_id | candidate_assessments.candidate_id = candidates.candidate_id | 

### Response:

select student_id from student_course_registrations group by student_id order by count ( * ) asc limit 1

### Instruction:

Convert text to sql: What are the ids of the students who registered for some courses but had the least number of courses for all students? | addresses : address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country | people : person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password | students : student_id , student_details | courses : course_id , course_name , course_description , other_details | people_addresses : person_address_id , person_id , address_id , date_from , date_to | student_course_registrations : student_id , course_id , registration_date | student_course_attendance : student_id , course_id , date_of_attendance | candidates : candidate_id , candidate_details | candidate_assessments : candidate_id , qualification , assessment_date , asessment_outcome_code | students.student_id = people.person_id | people_addresses.address_id = addresses.address_id | people_addresses.person_id = people.person_id | student_course_registrations.course_id = courses.course_id | student_course_registrations.student_id = students.student_id | student_course_attendance.student_id = student_course_registrations.student_id | student_course_attendance.course_id = student_course_registrations.course_id | candidates.candidate_id = people.person_id | candidate_assessments.candidate_id = candidates.candidate_id | 

### Response:

select student_id from student_course_registrations group by student_id order by count ( * ) asc limit 1
### Instruction:

Convert text to sql: what are the first name and last name of all candidates? | addresses : address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country | people : person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password | students : student_id , student_details | courses : course_id , course_name , course_description , other_details | people_addresses : person_address_id , person_id , address_id , date_from , date_to | student_course_registrations : student_id , course_id , registration_date | student_course_attendance : student_id , course_id , date_of_attendance | candidates : candidate_id , candidate_details | candidate_assessments : candidate_id , qualification , assessment_date , asessment_outcome_code | students.student_id = people.person_id | people_addresses.address_id = addresses.address_id | people_addresses.person_id = people.person_id | student_course_registrations.course_id = courses.course_id | student_course_registrations.student_id = students.student_id | student_course_attendance.student_id = student_course_registrations.student_id | student_course_attendance.course_id = student_course_registrations.course_id | candidates.candidate_id = people.person_id | candidate_assessments.candidate_id = candidates.candidate_id | 

### Response:

select people.first_name , people.last_name from candidates join people on candidates.candidate_id = people.person_id

### Instruction:

Convert text to sql: What are the first and last names of all the candidates? | addresses : address_id , line_1 , line_2 , city , zip_postcode , state_province_county , country | people : person_id , first_name , middle_name , last_name , cell_mobile_number , email_address , login_name , password | students : student_id , student_details | courses : course_id , course_name , course_description , other_details | people_addresses : person_address_id , person_id , address_id , date_from , date_to | student_course_registrations : student_id , course_id , registration_date | student_course_attendance : student_id , course_id , date_of_attendance | candidates : candidate_id , candidate_details | candidate_assessments : candidate_id , qualification , assessment_date , asessment_outcome_code | students.student_id = people.person_id | people_addresses.address_id = addresses.address_id | people_addresses.person_id = people.person_id | student_course_registrations.course_id = courses.course_id | student_course_registrations.student_id = students.student_id | student_course_attendance.student_id = student_course_registrations.student_id | student_course_attendance.course_id = student_course_registrations.course_id | candidates.candidate_id = people.person_id | candidate_assessments.candidate_id = candidates.candidate_id | 

### Response:

select people.first_name , people.last_name from candidates join people on candidates.candidate_id = people.person_id