messages
list |
---|
[
{
"content": "How many females does this network has?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Person WHERE gender = 'female'",
"role": "assistant"
}
]
|
[
{
"content": "How many females are in the network?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Person WHERE gender = 'female'",
"role": "assistant"
}
]
|
[
{
"content": "What is the average age for all person?",
"role": "user"
},
{
"content": "SELECT avg(age) FROM Person",
"role": "assistant"
}
]
|
[
{
"content": "What is the average age for all people in the table?",
"role": "user"
},
{
"content": "SELECT avg(age) FROM Person",
"role": "assistant"
}
]
|
[
{
"content": "How many different cities are they from?",
"role": "user"
},
{
"content": "SELECT count(DISTINCT city) FROM Person",
"role": "assistant"
}
]
|
[
{
"content": "How many different cities do people originate from?",
"role": "user"
},
{
"content": "SELECT count(DISTINCT city) FROM Person",
"role": "assistant"
}
]
|
[
{
"content": "How many type of jobs do they have?",
"role": "user"
},
{
"content": "SELECT count(DISTINCT job) FROM Person",
"role": "assistant"
}
]
|
[
{
"content": "How many different jobs are listed?",
"role": "user"
},
{
"content": "SELECT count(DISTINCT job) FROM Person",
"role": "assistant"
}
]
|
[
{
"content": "Who is the oldest person?",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)",
"role": "assistant"
}
]
|
[
{
"content": "What is the name of the person who is the oldest?",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)",
"role": "assistant"
}
]
|
[
{
"content": "Who is the oldest person whose job is student?",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' )",
"role": "assistant"
}
]
|
[
{
"content": "What is the name of the oldest student?",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' )",
"role": "assistant"
}
]
|
[
{
"content": "Who is the youngest male?",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' )",
"role": "assistant"
}
]
|
[
{
"content": "What is the name of the youngest male?",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' )",
"role": "assistant"
}
]
|
[
{
"content": "How old is the doctor named Zach?",
"role": "user"
},
{
"content": "SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'",
"role": "assistant"
}
]
|
[
{
"content": "What is the age of the doctor named Zach?",
"role": "user"
},
{
"content": "SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'",
"role": "assistant"
}
]
|
[
{
"content": "Who is the person whose age is below 30?",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE age < 30",
"role": "assistant"
}
]
|
[
{
"content": "What is the name of the person whose age is below 30?",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE age < 30",
"role": "assistant"
}
]
|
[
{
"content": "How many people whose age is greater 30 and job is engineer?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'",
"role": "assistant"
}
]
|
[
{
"content": "HOw many engineers are older than 30?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'",
"role": "assistant"
}
]
|
[
{
"content": "What is the average age for each gender?",
"role": "user"
},
{
"content": "SELECT avg(age) , gender FROM Person GROUP BY gender",
"role": "assistant"
}
]
|
[
{
"content": "How old is each gender, on average?",
"role": "user"
},
{
"content": "SELECT avg(age) , gender FROM Person GROUP BY gender",
"role": "assistant"
}
]
|
[
{
"content": "What is average age for different job title?",
"role": "user"
},
{
"content": "SELECT avg(age) , job FROM Person GROUP BY job",
"role": "assistant"
}
]
|
[
{
"content": "How old is the average person for each job?",
"role": "user"
},
{
"content": "SELECT avg(age) , job FROM Person GROUP BY job",
"role": "assistant"
}
]
|
[
{
"content": "What is average age of male for different job title?",
"role": "user"
},
{
"content": "SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job",
"role": "assistant"
}
]
|
[
{
"content": "What is the average age for a male in each job?",
"role": "user"
},
{
"content": "SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job",
"role": "assistant"
}
]
|
[
{
"content": "What is minimum age for different job title?",
"role": "user"
},
{
"content": "SELECT min(age) , job FROM Person GROUP BY job",
"role": "assistant"
}
]
|
[
{
"content": "How old is the youngest person for each job?",
"role": "user"
},
{
"content": "SELECT min(age) , job FROM Person GROUP BY job",
"role": "assistant"
}
]
|
[
{
"content": "Find the number of people who is under 40 for each gender.",
"role": "user"
},
{
"content": "SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender",
"role": "assistant"
}
]
|
[
{
"content": "How many people are under 40 for each gender?",
"role": "user"
},
{
"content": "SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender",
"role": "assistant"
}
]
|
[
{
"content": "Find the name of people whose age is greater than any engineer sorted by their age.",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age",
"role": "assistant"
}
]
|
[
{
"content": "What is the name of all the people who are older than at least one engineer? Order them by age.",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age",
"role": "assistant"
}
]
|
[
{
"content": "Find the number of people whose age is greater than all engineers.",
"role": "user"
},
{
"content": "SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer')",
"role": "assistant"
}
]
|
[
{
"content": "How many people are older than every engineer?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer')",
"role": "assistant"
}
]
|
[
{
"content": "list the name, job title of all people ordered by their names.",
"role": "user"
},
{
"content": "SELECT name , job FROM Person ORDER BY name",
"role": "assistant"
}
]
|
[
{
"content": "What are the names and job titles of every person ordered alphabetically by name?",
"role": "user"
},
{
"content": "SELECT name , job FROM Person ORDER BY name",
"role": "assistant"
}
]
|
[
{
"content": "Find the names of all person sorted in the descending order using age.",
"role": "user"
},
{
"content": "SELECT name FROM Person ORDER BY age DESC",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of everybody sorted by age in descending order?",
"role": "user"
},
{
"content": "SELECT name FROM Person ORDER BY age DESC",
"role": "assistant"
}
]
|
[
{
"content": "Find the name and age of all males in order of their age.",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE gender = 'male' ORDER BY age",
"role": "assistant"
}
]
|
[
{
"content": "What is the name and age of every male? Order the results by age.",
"role": "user"
},
{
"content": "SELECT name FROM Person WHERE gender = 'male' ORDER BY age",
"role": "assistant"
}
]
|
[
{
"content": "Find the name and age of the person who is a friend of both Dan and Alice.",
"role": "user"
},
{
"content": "SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'",
"role": "assistant"
}
]
|
[
{
"content": "What are the names and ages of every person who is a friend of both Dan and Alice?",
"role": "user"
},
{
"content": "SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'",
"role": "assistant"
}
]
|
[
{
"content": "Find the name and age of the person who is a friend of Dan or Alice.",
"role": "user"
},
{
"content": "SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'",
"role": "assistant"
}
]
|
[
{
"content": "What are the different names and ages of every friend of either Dan or alice?",
"role": "user"
},
{
"content": "SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'",
"role": "assistant"
}
]
|
[
{
"content": "Find the name of the person who has friends with age above 40 and under age 30?",
"role": "user"
},
{
"content": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of every person who has a friend over 40 and under 30?",
"role": "user"
},
{
"content": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)",
"role": "assistant"
}
]
|
[
{
"content": "Find the name of the person who has friends with age above 40 but not under age 30?",
"role": "user"
},
{
"content": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of the people who are older 40 but no friends under age 30?",
"role": "user"
},
{
"content": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)",
"role": "assistant"
}
]
|
[
{
"content": "Find the name of the person who has no student friends.",
"role": "user"
},
{
"content": "SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of the people who have no friends who are students?",
"role": "user"
},
{
"content": "SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'",
"role": "assistant"
}
]
|
[
{
"content": "Find the person who has exactly one friend.",
"role": "user"
},
{
"content": "SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of everybody who has exactly one friend?",
"role": "user"
},
{
"content": "SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1",
"role": "assistant"
}
]
|
[
{
"content": "Who are the friends of Bob?",
"role": "user"
},
{
"content": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'",
"role": "assistant"
}
]
|
[
{
"content": "Who are Bob's friends?",
"role": "user"
},
{
"content": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'",
"role": "assistant"
}
]
|
[
{
"content": "Find the name of persons who are friends with Bob.",
"role": "user"
},
{
"content": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of all of Bob's friends?",
"role": "user"
},
{
"content": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'",
"role": "assistant"
}
]
|
[
{
"content": "Find the names of females who are friends with Zach",
"role": "user"
},
{
"content": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of all females who are friends with Zach?",
"role": "user"
},
{
"content": "SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'",
"role": "assistant"
}
]
|
[
{
"content": "Find the female friends of Alice.",
"role": "user"
},
{
"content": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'",
"role": "assistant"
}
]
|
[
{
"content": "What are all the friends of Alice who are female?",
"role": "user"
},
{
"content": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'",
"role": "assistant"
}
]
|
[
{
"content": "Find the male friend of Alice whose job is a doctor?",
"role": "user"
},
{
"content": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'",
"role": "assistant"
}
]
|
[
{
"content": "Who are the friends of Alice that are doctors?",
"role": "user"
},
{
"content": "SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'",
"role": "assistant"
}
]
|
[
{
"content": "Who has a friend that is from new york city?",
"role": "user"
},
{
"content": "SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of all friends who are from New York?",
"role": "user"
},
{
"content": "SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'",
"role": "assistant"
}
]
|
[
{
"content": "Who has friends that are younger than the average age?",
"role": "user"
},
{
"content": "SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) FROM person)",
"role": "assistant"
}
]
|
[
{
"content": "What are the different names of friends who are younger than the average age for a friend?",
"role": "user"
},
{
"content": "SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT avg(age) FROM person)",
"role": "assistant"
}
]
|
[
{
"content": "Who has friends that are older than the average age? Print their friends and their ages as well",
"role": "user"
},
{
"content": "SELECT DISTINCT T2.name , T2.friend , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT avg(age) FROM person)",
"role": "assistant"
}
]
|
[
{
"content": "Whare the names, friends, and ages of all people who are older than the average age of a person?",
"role": "user"
},
{
"content": "SELECT DISTINCT T2.name , T2.friend , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT avg(age) FROM person)",
"role": "assistant"
}
]
|
[
{
"content": "Who is the friend of Zach with longest year relationship?",
"role": "user"
},
{
"content": "SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')",
"role": "assistant"
}
]
|
[
{
"content": "Which friend of Zach has the longest-lasting friendship?",
"role": "user"
},
{
"content": "SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')",
"role": "assistant"
}
]
|
[
{
"content": "What is the age of the friend of Zach with longest year relationship?",
"role": "user"
},
{
"content": "SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')",
"role": "assistant"
}
]
|
[
{
"content": "What are the ages of all of Zach's friends who are in the longest relationship?",
"role": "user"
},
{
"content": "SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')",
"role": "assistant"
}
]
|
[
{
"content": "Find the name of persons who are friends with Alice for the shortest years.",
"role": "user"
},
{
"content": "SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice')",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of all people who are friends with Alice for the shortest amount of time?",
"role": "user"
},
{
"content": "SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice')",
"role": "assistant"
}
]
|
[
{
"content": "Find the name, age, and job title of persons who are friends with Alice for the longest years.",
"role": "user"
},
{
"content": "SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')",
"role": "assistant"
}
]
|
[
{
"content": "What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time?",
"role": "user"
},
{
"content": "SELECT T1.name , T1.age , T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT max(YEAR) FROM PersonFriend WHERE friend = 'Alice')",
"role": "assistant"
}
]
|
[
{
"content": "Who is the person that has no friend?",
"role": "user"
},
{
"content": "SELECT name FROM person EXCEPT SELECT name FROM PersonFriend",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of all people who do not have friends?",
"role": "user"
},
{
"content": "SELECT name FROM person EXCEPT SELECT name FROM PersonFriend",
"role": "assistant"
}
]
|
[
{
"content": "Which person whose friends have the oldest average age?",
"role": "user"
},
{
"content": "SELECT T2.name , avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "What is the name of the person who has the oldest average age for their friends, and what is that average age?",
"role": "user"
},
{
"content": "SELECT T2.name , avg(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY avg(T1.age) DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "What is the total number of people who has no friend living in the city of Austin.",
"role": "user"
},
{
"content": "SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin')",
"role": "assistant"
}
]
|
[
{
"content": "What is the total number of people who have no friends living in Austin?",
"role": "user"
},
{
"content": "SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin')",
"role": "assistant"
}
]
|
[
{
"content": "Find Alice's friends of friends.",
"role": "user"
},
{
"content": "SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name != 'Alice'",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of all of Alice's friends of friends?",
"role": "user"
},
{
"content": "SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name != 'Alice'",
"role": "assistant"
}
]
|
[
{
"content": "How many members are there?",
"role": "user"
},
{
"content": "SELECT count(*) FROM member",
"role": "assistant"
}
]
|
[
{
"content": "List the names of members in ascending alphabetical order.",
"role": "user"
},
{
"content": "SELECT Name FROM member ORDER BY Name ASC",
"role": "assistant"
}
]
|
[
{
"content": "What are the names and countries of members?",
"role": "user"
},
{
"content": "SELECT Name , Country FROM member",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of members whose country is \"United States\" or \"Canada\".",
"role": "user"
},
{
"content": "SELECT Name FROM member WHERE Country = \"United States\" OR Country = \"Canada\"",
"role": "assistant"
}
]
|
[
{
"content": "Show the different countries and the number of members from each.",
"role": "user"
},
{
"content": "SELECT Country , COUNT(*) FROM member GROUP BY Country",
"role": "assistant"
}
]
|
[
{
"content": "Show the most common country across members.",
"role": "user"
},
{
"content": "SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "Which countries have more than two members?",
"role": "user"
},
{
"content": "SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2",
"role": "assistant"
}
]
|
[
{
"content": "Show the leader names and locations of colleges.",
"role": "user"
},
{
"content": "SELECT Leader_Name , College_Location FROM college",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of members and names of colleges they go to.",
"role": "user"
},
{
"content": "SELECT T2.Name , T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.",
"role": "user"
},
{
"content": "SELECT T2.Name , T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name ASC",
"role": "assistant"
}
]
|
[
{
"content": "Show the distinct leader names of colleges associated with members from country \"Canada\".",
"role": "user"
},
{
"content": "SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = \"Canada\"",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of members and the decoration themes they have.",
"role": "user"
},
{
"content": "SELECT T1.Name , T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of members that have a rank in round higher than 3.",
"role": "user"
},
{
"content": "SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of members in ascending order of their rank in rounds.",
"role": "user"
},
{
"content": "SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round ASC",
"role": "assistant"
}
]
|
[
{
"content": "List the names of members who did not participate in any round.",
"role": "user"
},
{
"content": "SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM round)",
"role": "assistant"
}
]
|
[
{
"content": "Find the name and access counts of all documents, in alphabetic order of the document name.",
"role": "user"
},
{
"content": "SELECT document_name , access_count FROM documents ORDER BY document_name",
"role": "assistant"
}
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.