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

Convert text to sql: Which allergy type has most number of allergies? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select allergytype from allergy_type group by allergytype order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which allergy type is most common? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select allergytype from allergy_type group by allergytype order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Which allergy type has least number of allergies? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select allergytype from allergy_type group by allergytype order by count ( * ) asc limit 1

### Instruction:

Convert text to sql: Which allergy type is the least common? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select allergytype from allergy_type group by allergytype order by count ( * ) asc limit 1

### Instruction:

Convert text to sql: How many students are there? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from student

### Instruction:

Convert text to sql: What is the total number of students? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from student

### Instruction:

Convert text to sql: Show first name and last name for all students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select fname , lname from student

### Instruction:

Convert text to sql: What are the full names of all students | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select fname , lname from student
### Instruction:

Convert text to sql: How many different advisors are listed? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( distinct advisor ) from student

### Instruction:

Convert text to sql: How many advisors are there? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( distinct advisor ) from student

### Instruction:

Convert text to sql: Show all majors. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select distinct major from student

### Instruction:

Convert text to sql: What are the different majors? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select distinct major from student

### Instruction:

Convert text to sql: Show all cities where students live. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select distinct city_code from student

### Instruction:

Convert text to sql: What cities do students live in? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select distinct city_code from student

### Instruction:

Convert text to sql: Show first name, last name, age for all female students. Their sex is F. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select fname , lname , age from student where sex = 'F'

### Instruction:

Convert text to sql: What are the full names and ages for all female students whose sex is F? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select fname , lname , age from student where sex = 'F'
### Instruction:

Convert text to sql: Show student ids for all male students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from student where sex = 'M'

### Instruction:

Convert text to sql: What are the student ids for all male students? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from student where sex = 'M'

### Instruction:

Convert text to sql: How many students are age 18? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from student where age = 18

### Instruction:

Convert text to sql: How many students are 18 years old? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from student where age = 18

### Instruction:

Convert text to sql: Show all student ids who are older than 20. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from student where age > 20

### Instruction:

Convert text to sql: What are the student ids for students over 20 years old? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from student where age > 20

### Instruction:

Convert text to sql: Which city does the student whose last name is "Kim" live in? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select city_code from student where lname = 'Kim'

### Instruction:

Convert text to sql: Give the city that the student whose family name is Kim lives in. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select city_code from student where lname = 'Kim'
### Instruction:

Convert text to sql: Who is the advisor of student with ID 1004? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select advisor from student where stuid = 1004

### Instruction:

Convert text to sql: Who advises student 1004? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select advisor from student where stuid = 1004

### Instruction:

Convert text to sql: How many students live in HKG or CHI? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from student where city_code = 'HKG' or city_code = 'CHI'

### Instruction:

Convert text to sql: Give the number of students living in either HKG or CHI. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from student where city_code = 'HKG' or city_code = 'CHI'

### Instruction:

Convert text to sql: Show the minimum, average, and maximum age of all students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select min ( age ) , avg ( age ) , max ( age ) from student

### Instruction:

Convert text to sql: What is the minimum, mean, and maximum age across all students? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select min ( age ) , avg ( age ) , max ( age ) from student

### Instruction:

Convert text to sql: What is the last name of the youngest student? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select lname from student where age = ( select min ( age ) from student )

### Instruction:

Convert text to sql: Provide the last name of the youngest student. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select lname from student where age = ( select min ( age ) from student )
### Instruction:

Convert text to sql: Show the student id of the oldest student. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from student where age = ( select max ( age ) from student )

### Instruction:

Convert text to sql: What student id corresponds to the oldest student? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from student where age = ( select max ( age ) from student )

### Instruction:

Convert text to sql: Show all majors and corresponding number of students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select major , count ( * ) from student group by major

### Instruction:

Convert text to sql: How many students are there for each major? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select major , count ( * ) from student group by major

### Instruction:

Convert text to sql: Which major has most number of students? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select major from student group by major order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: What is the largest major? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select major from student group by major order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Show all ages and corresponding number of students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select age , count ( * ) from student group by age

### Instruction:

Convert text to sql: How old is each student and how many students are each age? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select age , count ( * ) from student group by age
### Instruction:

Convert text to sql: Show the average age for male and female students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select avg ( age ) , sex from student group by sex

### Instruction:

Convert text to sql: What are the average ages for male and female students? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select avg ( age ) , sex from student group by sex

### Instruction:

Convert text to sql: Show all cities and corresponding number of students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select city_code , count ( * ) from student group by city_code

### Instruction:

Convert text to sql: How many students live in each city? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select city_code , count ( * ) from student group by city_code

### Instruction:

Convert text to sql: Show all advisors and corresponding number of students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select advisor , count ( * ) from student group by advisor

### Instruction:

Convert text to sql: How many students does each advisor have? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select advisor , count ( * ) from student group by advisor

### Instruction:

Convert text to sql: Which advisor has most number of students? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select advisor from student group by advisor order by count ( * ) desc limit 1

### Instruction:

Convert text to sql: Give the advisor with the most students. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select advisor from student group by advisor order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: How many students have cat allergies? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from has_allergy where allergy = 'Cat'

### Instruction:

Convert text to sql: How many students are affected by cat allergies? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from has_allergy where allergy = 'Cat'

### Instruction:

Convert text to sql: Show all student IDs who have at least two allergies. | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from has_allergy group by stuid having count ( * ) >= 2

### Instruction:

Convert text to sql: What are the students ids of students who have more than one allergy? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from has_allergy group by stuid having count ( * ) >= 2

### Instruction:

Convert text to sql: What are the student ids of students who don't have any allergies? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from student except select stuid from has_allergy

### Instruction:

Convert text to sql: Which students are unaffected by allergies? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select stuid from student except select stuid from has_allergy

### Instruction:

Convert text to sql: How many female students have milk or egg allergies? | allergy_type : allergy , allergytype | has_allergy : stuid , allergy | student : stuid , lname , fname , age , sex , major , advisor , city_code | has_allergy.allergy = allergy_type.allergy | has_allergy.stuid = student.stuid | 

### Response:

select count ( * ) from has_allergy join student on has_allergy.stuid = student.stuid where student.sex = 'F' and has_allergy.allergy = 'Milk' or has_allergy.allergy = 'Eggs'