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

Convert text to sql: List the description of the outcomes for all projects. | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select _ from _ | select research_outcomes.outcome_description from research_outcomes join project_outcomes on research_outcomes.outcome_code = project_outcomes.outcome_code
### Instruction:

Convert text to sql: Which role is most common for the staff? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select _ from _ group by _ order by count ( _ ) desc limit _ | select role_code from project_staff group by role_code order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: What is the most common role for the staff? | document_types : document_type_code , document_description | documents : document_id , document_type_code , grant_id , sent_date , response_received_date , other_details | grants : grant_id , organisation_id , grant_amount , grant_start_date , grant_end_date , other_details | organisation_types : organisation_type , organisation_type_description | organisations : organisation_id , organisation_type , organisation_details | project_outcomes : project_id , outcome_code , outcome_details | project_staff : staff_id , project_id , role_code , date_from , date_to , other_details | projects : project_id , organisation_id , project_details | research_outcomes : outcome_code , outcome_description | research_staff : staff_id , employer_organisation_id , staff_details | staff_roles : role_code , role_description | tasks : task_id , project_id , task_details , eg agree objectives | documents.grant_id = grants.grant_id | documents.document_type_code = document_types.document_type_code | grants.organisation_id = organisations.organisation_id | organisations.organisation_type = organisation_types.organisation_type | project_outcomes.outcome_code = research_outcomes.outcome_code | project_outcomes.project_id = projects.project_id | project_staff.role_code = staff_roles.role_code | project_staff.project_id = projects.project_id | projects.organisation_id = organisations.organisation_id | research_staff.employer_organisation_id = organisations.organisation_id | tasks.project_id = projects.project_id | 

### Response:

select _ from _ group by _ order by count ( _ ) desc limit _ | select role_code from project_staff group by role_code order by count ( * ) desc limit 1
### Instruction:

Convert text to sql: How many friends does Dan have? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) from _ where _ | select count ( personfriend.friend ) from person join personfriend on person.name = personfriend.name where person.name = 'Dan'
### Instruction:

Convert text to sql: How many females does this network has? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) from _ where _ | select count ( * ) from person where gender = 'female'
### Instruction:

Convert text to sql: How many females are in the network? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) from _ where _ | select count ( * ) from person where gender = 'female'
### Instruction:

Convert text to sql: What is the average age for all person? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select avg ( _ ) from _ | select avg ( age ) from person
### Instruction:

Convert text to sql: What is the average age for all people in the table? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select avg ( _ ) from _ | select avg ( age ) from person
### Instruction:

Convert text to sql: How many different cities are they from? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( distinct _ ) from _ | select count ( distinct city ) from person
### Instruction:

Convert text to sql: How many different cities do people originate from? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( distinct _ ) from _ | select count ( distinct city ) from person
### Instruction:

Convert text to sql: How many type of jobs do they have? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( distinct _ ) from _ | select count ( distinct job ) from person
### Instruction:

Convert text to sql: How many different jobs are listed? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( distinct _ ) from _ | select count ( distinct job ) from person
### Instruction:

Convert text to sql: Who is the oldest person? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ = ( select max ( _ ) from _ ) | select name from person where age = ( select max ( age ) from person )
### Instruction:

Convert text to sql: What is the name of the person who is the oldest? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ = ( select max ( _ ) from _ ) | select name from person where age = ( select max ( age ) from person )
### Instruction:

Convert text to sql: Who is the oldest person whose job is student? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ = ( select max ( _ ) from _ where _ ) | select name from person where job = 'student' and age = ( select max ( age ) from person where job = 'student' )
### Instruction:

Convert text to sql: What is the name of the oldest student? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ = ( select max ( _ ) from _ where _ ) | select name from person where job = 'student' and age = ( select max ( age ) from person where job = 'student' )
### Instruction:

Convert text to sql: Who is the youngest male? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ = ( select min ( _ ) from _ where _ ) | select name from person where gender = 'male' and age = ( select min ( age ) from person where gender = 'male' )
### Instruction:

Convert text to sql: What is the name of the youngest male? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ = ( select min ( _ ) from _ where _ ) | select name from person where gender = 'male' and age = ( select min ( age ) from person where gender = 'male' )
### Instruction:

Convert text to sql: How old is the doctor named Zach? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ | select age from person where job = 'doctor' and name = 'Zach'
### Instruction:

Convert text to sql: What is the age of the doctor named Zach? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ | select age from person where job = 'doctor' and name = 'Zach'
### Instruction:

Convert text to sql: Who is the person whose age is below 30? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ | select name from person where age < 30
### Instruction:

Convert text to sql: What is the name of the person whose age is below 30? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ | select name from person where age < 30
### Instruction:

Convert text to sql: How many people whose age is greater 30 and job is engineer? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) from _ where _ | select count ( * ) from person where age > 30 and job = 'engineer'
### Instruction:

Convert text to sql: HOw many engineers are older than 30? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) from _ where _ | select count ( * ) from person where age > 30 and job = 'engineer'
### Instruction:

Convert text to sql: What is the average age for each gender? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select avg ( _ ) , _ from _ group by _ | select avg ( age ) , gender from person group by gender
### Instruction:

Convert text to sql: How old is each gender, on average? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select avg ( _ ) , _ from _ group by _ | select avg ( age ) , gender from person group by gender
### Instruction:

Convert text to sql: What is average age for different job title? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select avg ( _ ) , _ from _ group by _ | select avg ( age ) , job from person group by job
### Instruction:

Convert text to sql: How old is the average person for each job? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select avg ( _ ) , _ from _ group by _ | select avg ( age ) , job from person group by job
### Instruction:

Convert text to sql: What is average age of male for different job title? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select avg ( _ ) , _ from _ where _ group by _ | select avg ( age ) , job from person where gender = 'male' group by job
### Instruction:

Convert text to sql: What is the average age for a male in each job? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select avg ( _ ) , _ from _ where _ group by _ | select avg ( age ) , job from person where gender = 'male' group by job
### Instruction:

Convert text to sql: What is minimum age for different job title? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select min ( _ ) , _ from _ group by _ | select min ( age ) , job from person group by job
### Instruction:

Convert text to sql: How old is the youngest person for each job? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select min ( _ ) , _ from _ group by _ | select min ( age ) , job from person group by job
### Instruction:

Convert text to sql: Find the number of people who is under 40 for each gender. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) , _ from _ where _ group by _ | select count ( * ) , gender from person where age < 40 group by gender
### Instruction:

Convert text to sql: How many people are under 40 for each gender? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) , _ from _ where _ group by _ | select count ( * ) , gender from person where age < 40 group by gender
### Instruction:

Convert text to sql: Find the name of people whose age is greater than any engineer sorted by their age. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ > ( select min ( _ ) from _ where _ ) order by _ asc | select name from person where age > ( select min ( age ) from person where job = 'engineer' ) order by age asc
### Instruction:

Convert text to sql: What is the name of all the people who are older than at least one engineer? Order them by age. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ > ( select min ( _ ) from _ where _ ) order by _ asc | select name from person where age > ( select min ( age ) from person where job = 'engineer' ) order by age asc
### Instruction:

Convert text to sql: Find the number of people whose age is greater than all engineers. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) from _ where _ > ( select max ( _ ) from _ where _ ) | select count ( * ) from person where age > ( select max ( age ) from person where job = 'engineer' )
### Instruction:

Convert text to sql: How many people are older than every engineer? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select count ( _ ) from _ where _ > ( select max ( _ ) from _ where _ ) | select count ( * ) from person where age > ( select max ( age ) from person where job = 'engineer' )
### Instruction:

Convert text to sql: list the name, job title of all people ordered by their names. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ order by _ asc | select name , job from person order by name asc
### Instruction:

Convert text to sql: What are the names and job titles of every person ordered alphabetically by name? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ order by _ asc | select name , job from person order by name asc
### Instruction:

Convert text to sql: Find the names of all person sorted in the descending order using age. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ order by _ desc | select name from person order by age desc
### Instruction:

Convert text to sql: What are the names of everybody sorted by age in descending order? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ order by _ desc | select name from person order by age desc
### Instruction:

Convert text to sql: Find the name and age of all males in order of their age. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ order by _ asc | select name from person where gender = 'male' order by age asc
### Instruction:

Convert text to sql: What is the name and age of every male? Order the results by age. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ order by _ asc | select name from person where gender = 'male' order by age asc
### Instruction:

Convert text to sql: Find the name and age of the person who is a friend of both Dan and Alice. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ intersect select _ from _ where _ | select person.name , person.age from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Dan' intersect select person.name , person.age from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Alice'
### Instruction:

Convert text to sql: What are the names and ages of every person who is a friend of both Dan and Alice? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ intersect select _ from _ where _ | select person.name , person.age from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Dan' intersect select person.name , person.age from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Alice'
### Instruction:

Convert text to sql: Find the name and age of the person who is a friend of Dan or Alice. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select distinct _ from _ where _ | select distinct person.name , person.age from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Dan' or personfriend.friend = 'Alice'
### Instruction:

Convert text to sql: What are the different names and ages of every friend of either Dan or alice? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select distinct _ from _ where _ | select distinct person.name , person.age from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Dan' or personfriend.friend = 'Alice'
### Instruction:

Convert text to sql: Find the name of the person who has friends with age above 40 and under age 30? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ in ( select _ from _ where _ ) intersect select _ from _ where _ in ( select _ from _ where _ ) | select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend in ( select name from person where age > 40 ) intersect select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend in ( select name from person where age < 30 )
### Instruction:

Convert text to sql: What are the names of every person who has a friend over 40 and under 30? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | 

### Response:

select _ from _ where _ in ( select _ from _ where _ ) intersect select _ from _ where _ in ( select _ from _ where _ ) | select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend in ( select name from person where age > 40 ) intersect select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend in ( select name from person where age < 30 )