db_id
stringlengths
4
31
text
stringlengths
370
4.84k
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 person where gender = 'female'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 person where gender = 'female'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) from person
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) from person
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 city ) from person
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 city ) from person
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 job ) from person
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 job ) from person
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where age = ( select max ( age ) from person )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where age = ( select max ( age ) from person )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where job = 'student' and age = ( select max ( age ) from person where job = 'student' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where job = 'student' and age = ( select max ( age ) from person where job = 'student' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where gender = 'male' and age = ( select min ( age ) from person where gender = 'male' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where gender = 'male' and age = ( select min ( age ) from person where gender = 'male' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 age from person where job = 'doctor' and name = 'Zach'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 age from person where job = 'doctor' and name = 'Zach'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where age < 30
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where age < 30
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 person where age > 30 and job = 'engineer'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 person where age > 30 and job = 'engineer'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) , gender from person group by gender
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) , gender from person group by gender
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) , job from person group by job
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) , job from person group by job
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) , job from person where gender = 'male' group by job
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) , job from person where gender = 'male' group by job
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) , job from person group by job
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( age ) , job from person group by job
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( * ) , gender from person where age < 40 group by gender
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 ( * ) , gender from person where age < 40 group by gender
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where age > ( select min ( age ) from person where job = 'engineer' ) order by age asc
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where age > ( select min ( age ) from person where job = 'engineer' ) order by age asc
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 person where age > ( select max ( age ) from person where job = 'engineer' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 person where age > ( select max ( age ) from person where job = 'engineer' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name , job from person order by name asc
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name , job from person order by name asc
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person order by age desc
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person order by age desc
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where gender = 'male' order by age asc
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 name from person where gender = 'male' order by age asc
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 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'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 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'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 person.name , person.age from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Dan' or personfriend.friend = 'Alice'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 person.name , person.age from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Dan' or personfriend.friend = 'Alice'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 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 )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### 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 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 )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the name of the person who has friends with age above 40 but not under age 30? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend in ( select name from person where age > 40 ) except select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend in ( select name from person where age < 30 )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of the people who are older 40 but no friends under age 30? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend in ( select name from person where age > 40 ) except select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend in ( select name from person where age < 30 )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the name of the person who has no student friends. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select name from person except select personfriend.name from person join personfriend on person.name = personfriend.friend where person.job = 'student'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of the people who have no friends who are students? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select name from person except select personfriend.name from person join personfriend on person.name = personfriend.friend where person.job = 'student'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the person who has exactly one friend. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select name from personfriend group by name having count ( * ) = 1
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of everybody who has exactly one friend? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select name from personfriend group by name having count ( * ) = 1
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Who are the friends of Bob? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.friend from person join personfriend on person.name = personfriend.name where person.name = 'Bob'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Who are Bob's friends? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.friend from person join personfriend on person.name = personfriend.name where person.name = 'Bob'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the name of persons who are friends with Bob. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Bob'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of all of Bob's friends? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Bob'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the names of females who are friends with Zach | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Zach' and person.gender = 'female'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of all females who are friends with Zach? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.name from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Zach' and person.gender = 'female'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the female friends of Alice. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.friend from person join personfriend on person.name = personfriend.friend where personfriend.name = 'Alice' and person.gender = 'female'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are all the friends of Alice who are female? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.friend from person join personfriend on person.name = personfriend.friend where personfriend.name = 'Alice' and person.gender = 'female'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the male friend of Alice whose job is a doctor? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.friend from person join personfriend on person.name = personfriend.friend where personfriend.name = 'Alice' and person.gender = 'male' and person.job = 'doctor'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Who are the friends of Alice that are doctors? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.friend from person join personfriend on person.name = personfriend.friend where personfriend.name = 'Alice' and person.gender = 'male' and person.job = 'doctor'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Who has a friend that is from new york city? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.name from person join personfriend on person.name = personfriend.friend where person.city = 'new york city'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of all friends who are from New York? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.name from person join personfriend on person.name = personfriend.friend where person.city = 'new york city'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Who has friends that are younger than the average age? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select distinct personfriend.name from person join personfriend on person.name = personfriend.friend where person.age < ( select avg ( age ) from person )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the different names of friends who are younger than the average age for a friend? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select distinct personfriend.name from person join personfriend on person.name = personfriend.friend where person.age < ( select avg ( age ) from person )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Who has friends that are older than the average age? Print their friends and their ages as well | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select distinct personfriend.name , personfriend.friend , person.age from person join personfriend on person.name = personfriend.friend where person.age > ( select avg ( age ) from person )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Whare the names, friends, and ages of all people who are older than the average age of a person? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select distinct personfriend.name , personfriend.friend , person.age from person join personfriend on person.name = personfriend.friend where person.age > ( select avg ( age ) from person )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Who is the friend of Zach with longest year relationship? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select friend from personfriend where name = 'Zach' and year = ( select max ( year ) from personfriend where name = 'Zach' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which friend of Zach has the longest-lasting friendship? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select friend from personfriend where name = 'Zach' and year = ( select max ( year ) from personfriend where name = 'Zach' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the age of the friend of Zach with longest year relationship? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.age from person join personfriend on person.name = personfriend.friend where personfriend.name = 'Zach' and personfriend.year = ( select max ( year ) from personfriend where name = 'Zach' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the ages of all of Zach's friends who are in the longest relationship? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.age from person join personfriend on person.name = personfriend.friend where personfriend.name = 'Zach' and personfriend.year = ( select max ( year ) from personfriend where name = 'Zach' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the name of persons who are friends with Alice for the shortest years. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select name from personfriend where friend = 'Alice' and year = ( select min ( year ) from personfriend where friend = 'Alice' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of all people who are friends with Alice for the shortest amount of time? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select name from personfriend where friend = 'Alice' and year = ( select min ( year ) from personfriend where friend = 'Alice' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the name, age, and job title of persons who are friends with Alice for the longest years. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.name , person.age , person.job from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Alice' and personfriend.year = ( select max ( year ) from personfriend where friend = 'Alice' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select person.name , person.age , person.job from person join personfriend on person.name = personfriend.name where personfriend.friend = 'Alice' and personfriend.year = ( select max ( year ) from personfriend where friend = 'Alice' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Who is the person that has no friend? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select name from person except select name from personfriend
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of all people who do not have friends? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select name from person except select name from personfriend
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which person whose friends have the oldest average age? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.name , avg ( person.age ) from person join personfriend on person.name = personfriend.friend group by personfriend.name order by avg ( person.age ) desc limit 1
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the name of the person who has the oldest average age for their friends, and what is that average age? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select personfriend.name , avg ( person.age ) from person join personfriend on person.name = personfriend.friend group by personfriend.name order by avg ( person.age ) desc limit 1
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the total number of people who has no friend living in the city of Austin. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select count ( distinct name ) from personfriend where friend not in ( select name from person where city = 'Austin' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What is the total number of people who have no friends living in Austin? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select count ( distinct name ) from personfriend where friend not in ( select name from person where city = 'Austin' )
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find Alice's friends of friends. | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select distinct personfriend.name from personfriend join person on personfriend.name = person.name join personfriend on personfriend.friend = personfriend.name join personfriend on personfriend.friend = personfriend.name where person.name = 'Alice' and personfriend.name != 'Alice'
network_2
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names of all of Alice's friends of friends? | person : name , age , city , gender , job | personfriend : name , friend , year | personfriend.friend = person.name | personfriend.name = person.name | ### Response: select distinct personfriend.name from personfriend join person on personfriend.name = person.name join personfriend on personfriend.friend = personfriend.name join personfriend on personfriend.friend = personfriend.name where person.name = 'Alice' and personfriend.name != 'Alice'
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: How many members are there? | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select count ( * ) from member
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List the names of members in ascending alphabetical order. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select name from member order by name asc
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: What are the names and countries of members? | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select name , country from member
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the names of members whose country is "United States" or "Canada". | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select name from member where country = 'United States' or country = 'Canada'
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the different countries and the number of members from each. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select country , count ( * ) from member group by country
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the most common country across members. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select country from member group by country order by count ( * ) desc limit 1
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Which countries have more than two members? | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select country from member group by country having count ( * ) > 2
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the leader names and locations of colleges. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select leader_name , college_location from college
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the names of members and names of colleges they go to. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select member.name , college.name from college join member on college.college_id = member.college_id
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select member.name , college.college_location from college join member on college.college_id = member.college_id order by member.name asc
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the distinct leader names of colleges associated with members from country "Canada". | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select distinct college.leader_name from college join member on college.college_id = member.college_id where member.country = 'Canada'
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the names of members and the decoration themes they have. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select member.name , round.decoration_theme from member join round on member.member_id = round.member_id
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the names of members that have a rank in round higher than 3. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select member.name from member join round on member.member_id = round.member_id where round.rank_in_round > 3
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Show the names of members in ascending order of their rank in rounds. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select member.name from member join round on member.member_id = round.member_id order by rank_in_round asc
decoration_competition
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: List the names of members who did not participate in any round. | college : college_id , name , leader_name , college_location | member : member_id , name , country , college_id | round : round_id , member_id , decoration_theme , rank_in_round | member.college_id = college.college_id | round.member_id = member.member_id | ### Response: select name from member where member_id not in ( select member_id from round )
document_management
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Convert text to sql: Find the name and access counts of all documents, in alphabetic order of the document name. | roles : role_code , role_description | users : user_id , role_code , user_name , user_login , password | document_structures : document_structure_code , parent_document_structure_code , document_structure_description | functional_areas : functional_area_code , parent_functional_area_code , functional_area_description | images : image_id , image_alt_text , image_name , image_url | documents : document_code , document_structure_code , document_type_code , access_count , document_name | document_functional_areas : document_code , functional_area_code | document_sections : section_id , document_code , section_sequence , section_code , section_title | document_sections_images : section_id , image_id | users.role_code = roles.role_code | documents.document_structure_code = document_structures.document_structure_code | document_functional_areas.functional_area_code = functional_areas.functional_area_code | document_functional_areas.document_code = documents.document_code | document_sections.document_code = documents.document_code | document_sections_images.image_id = images.image_id | document_sections_images.section_id = document_sections.section_id | ### Response: select document_name , access_count from documents order by document_name asc