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

Convert text to sql: Find the number of students taught by the teacher KAWA GORDON. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) from list join teachers on list.classroom = teachers.classroom where teachers.firstname = 'KAWA' and teachers.lastname = 'GORDON'

### Instruction:

Convert text to sql: Find the number of students taught by TARRING LEIA. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) from list join teachers on list.classroom = teachers.classroom where teachers.firstname = 'TARRING' and teachers.lastname = 'LEIA'

### Instruction:

Convert text to sql: How many students are taught by teacher TARRING LEIA? | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) from list join teachers on list.classroom = teachers.classroom where teachers.firstname = 'TARRING' and teachers.lastname = 'LEIA'

### Instruction:

Convert text to sql: How many teachers does the student named CHRISSY NABOZNY have? | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) from list join teachers on list.classroom = teachers.classroom where list.firstname = 'CHRISSY' and list.lastname = 'NABOZNY'

### Instruction:

Convert text to sql: Find the number of teachers who teach the student called CHRISSY NABOZNY. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) from list join teachers on list.classroom = teachers.classroom where list.firstname = 'CHRISSY' and list.lastname = 'NABOZNY'

### Instruction:

Convert text to sql: How many teachers does the student named MADLOCK RAY have? | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) from list join teachers on list.classroom = teachers.classroom where list.firstname = 'MADLOCK' and list.lastname = 'RAY'

### Instruction:

Convert text to sql: Find the number of teachers who teach the student called MADLOCK RAY. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) from list join teachers on list.classroom = teachers.classroom where list.firstname = 'MADLOCK' and list.lastname = 'RAY'

### Instruction:

Convert text to sql: Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select distinct list.firstname , list.lastname from list join teachers on list.classroom = teachers.classroom where list.grade = 1 except select list.firstname , list.lastname from list join teachers on list.classroom = teachers.classroom where teachers.firstname = 'OTHA' and teachers.lastname = 'MOYER'
### Instruction:

Convert text to sql: What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER? | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select distinct list.firstname , list.lastname from list join teachers on list.classroom = teachers.classroom where list.grade = 1 except select list.firstname , list.lastname from list join teachers on list.classroom = teachers.classroom where teachers.firstname = 'OTHA' and teachers.lastname = 'MOYER'

### Instruction:

Convert text to sql: Find the last names of the students in third grade that are not taught by COVIN JEROME. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select distinct list.lastname from list join teachers on list.classroom = teachers.classroom where list.grade = 3 and teachers.firstname != 'COVIN' and teachers.lastname != 'JEROME'

### Instruction:

Convert text to sql: Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select distinct list.lastname from list join teachers on list.classroom = teachers.classroom where list.grade = 3 and teachers.firstname != 'COVIN' and teachers.lastname != 'JEROME'

### Instruction:

Convert text to sql: For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select grade , count ( distinct classroom ) , count ( * ) from list group by grade

### Instruction:

Convert text to sql: For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select grade , count ( distinct classroom ) , count ( * ) from list group by grade

### Instruction:

Convert text to sql: For each classroom, report the classroom number and the number of grades using it. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom , count ( distinct grade ) from list group by classroom

### Instruction:

Convert text to sql: For each classroom, show the classroom number and count the number of distinct grades that use the room. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom , count ( distinct grade ) from list group by classroom

### Instruction:

Convert text to sql: Which classroom has the most students? | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom from list group by classroom order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Find the classroom that the most students use. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom from list group by classroom order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Report the number of students in each classroom. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom , count ( * ) from list group by classroom

### Instruction:

Convert text to sql: For each classroom, show the classroom number and find how many students are using it. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom , count ( * ) from list group by classroom

### Instruction:

Convert text to sql: For each grade 0 classroom, report the total number of students. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom , count ( * ) from list where grade = '0' group by classroom

### Instruction:

Convert text to sql: For each grade 0 classroom, return the classroom number and the count of students. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom , count ( * ) from list where grade = '0' group by classroom

### Instruction:

Convert text to sql: Report the total number of students for each fourth-grade classroom. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom , count ( * ) from list where grade = '4' group by classroom

### Instruction:

Convert text to sql: For each fourth-grade classroom, show the classroom number and the total number of students using it. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select classroom , count ( * ) from list where grade = '4' group by classroom

### Instruction:

Convert text to sql: Find the name of the teacher who teaches the largest number of students. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select teachers.firstname , teachers.lastname from list join teachers on list.classroom = teachers.classroom group by teachers.firstname , teachers.lastname order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which teacher teaches the most students? Give me the first name and last name of the teacher. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select teachers.firstname , teachers.lastname from list join teachers on list.classroom = teachers.classroom group by teachers.firstname , teachers.lastname order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: Find the number of students in one classroom. | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) , classroom from list group by classroom

### Instruction:

Convert text to sql: How many students does one classroom have? | list : lastname , firstname , grade , classroom | teachers : lastname , firstname , classroom | 

### Response:

select count ( * ) , classroom from list group by classroom
### Instruction:

Convert text to sql: How many companies are headquartered in the US? | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select count ( * ) from company where headquarters = 'USA'

### Instruction:

Convert text to sql: List the names of companies by ascending number of sales. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select name from company order by sales_in_billion asc

### Instruction:

Convert text to sql: What are the headquarters and industries of all companies? | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select headquarters , industry from company

### Instruction:

Convert text to sql: Show the names of companies in the banking or retailing industry? | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select name from company where industry = 'Banking' or industry = 'Retailing'

### Instruction:

Convert text to sql: What is the maximum and minimum market value of companies? | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select max ( market_value_in_billion ) , min ( market_value_in_billion ) from company
### Instruction:

Convert text to sql: What is the headquarter of the company with the largest sales? | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select headquarters from company order by sales_in_billion desc limit 1

### Instruction:

Convert text to sql: Show the different headquarters and number of companies at each headquarter. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select headquarters , count ( * ) from company group by headquarters

### Instruction:

Convert text to sql: Show the most common headquarter for companies. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select headquarters from company group by headquarters order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show the headquarters that have at least two companies. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select headquarters from company group by headquarters having count ( * ) >= 2

### Instruction:

Convert text to sql: Show the headquarters that have both companies in banking industry and companies in oil and gas industry. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select headquarters from company where industry = 'Banking' intersect select headquarters from company where industry = 'Oil and gas'
### Instruction:

Convert text to sql: Show the names of companies and of employees. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select company.name , people.name from employment join people on employment.people_id = people.people_id join company on employment.company_id = company.company_id

### Instruction:

Convert text to sql: Show names of companies and that of employees in descending order of number of years working for that employee. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select company.name , people.name from employment join people on employment.people_id = people.people_id join company on employment.company_id = company.company_id order by employment.year_working asc

### Instruction:

Convert text to sql: Show the names of employees that work for companies with sales bigger than 200. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select people.name from employment join people on employment.people_id = people.people_id join company on employment.company_id = company.company_id where company.sales_in_billion > 200

### Instruction:

Convert text to sql: Show the names of companies and the number of employees they have | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select company.name , count ( * ) from employment join people on employment.people_id = people.people_id join company on employment.company_id = company.company_id group by company.name
### Instruction:

Convert text to sql: List the names of people that are not employed by any company | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select name from people where people_id not in ( select people_id from employment )

### Instruction:

Convert text to sql: list the names of the companies with more than 200 sales in the descending order of sales and profits. | people : people_id , age , name , nationality , graduation_college | company : company_id , name , headquarters , industry , sales_in_billion , profits_in_billion , assets_in_billion , market_value_in_billion | employment : company_id , people_id , year_working | employment.people_id = people.people_id | employment.company_id = company.company_id | 

### Response:

select name from company where sales_in_billion > 200 order by sales_in_billion , profits_in_billion desc
### Instruction:

Convert text to sql: How many film are there? | film : film_id , title , studio , director , gross_in_dollar | market : market_id , country , number_cities | film_market_estimation : estimation_id , low_estimate , high_estimate , film_id , type , market_id , year | film_market_estimation.market_id = market.market_id | film_market_estimation.film_id = film.film_id | 

### Response:

select count ( * ) from film

### Instruction:

Convert text to sql: Count the number of films. | film : film_id , title , studio , director , gross_in_dollar | market : market_id , country , number_cities | film_market_estimation : estimation_id , low_estimate , high_estimate , film_id , type , market_id , year | film_market_estimation.market_id = market.market_id | film_market_estimation.film_id = film.film_id | 

### Response:

select count ( * ) from film

### Instruction:

Convert text to sql: List the distinct director of all films. | film : film_id , title , studio , director , gross_in_dollar | market : market_id , country , number_cities | film_market_estimation : estimation_id , low_estimate , high_estimate , film_id , type , market_id , year | film_market_estimation.market_id = market.market_id | film_market_estimation.film_id = film.film_id | 

### Response:

select distinct director from film

### Instruction:

Convert text to sql: What are the different film Directors? | film : film_id , title , studio , director , gross_in_dollar | market : market_id , country , number_cities | film_market_estimation : estimation_id , low_estimate , high_estimate , film_id , type , market_id , year | film_market_estimation.market_id = market.market_id | film_market_estimation.film_id = film.film_id | 

### Response:

select distinct director from film

### Instruction:

Convert text to sql: What is the average ticket sales gross in dollars of films? | film : film_id , title , studio , director , gross_in_dollar | market : market_id , country , number_cities | film_market_estimation : estimation_id , low_estimate , high_estimate , film_id , type , market_id , year | film_market_estimation.market_id = market.market_id | film_market_estimation.film_id = film.film_id | 

### Response:

select avg ( gross_in_dollar ) from film

### Instruction:

Convert text to sql: Return the average gross sales in dollars across all films. | film : film_id , title , studio , director , gross_in_dollar | market : market_id , country , number_cities | film_market_estimation : estimation_id , low_estimate , high_estimate , film_id , type , market_id , year | film_market_estimation.market_id = market.market_id | film_market_estimation.film_id = film.film_id | 

### Response:

select avg ( gross_in_dollar ) from film