input stringlengths 667 7.62k | output stringlengths 41 600 | db_id stringlengths 3 31 | query stringlengths 18 577 | question stringlengths 3 224 | schema stringlengths 177 6.14k | primary_keys stringlengths 16 545 | foreign_keys stringlengths 16 1.48k |
|---|---|---|---|---|---|---|---|
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many females does this network has?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Person WHERE gender = 'female'</SQL_QUERY> | network_2 | SELECT count(*) FROM Person WHERE gender = 'female' | How many females does this network has? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many females are in the network?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Person WHERE gender = 'female'</SQL_QUERY> | network_2 | SELECT count(*) FROM Person WHERE gender = 'female' | How many females are in the network? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average age for all person?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) FROM Person</SQL_QUERY> | network_2 | SELECT avg(age) FROM Person | What is the average age for all person? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average age for all people in the table?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) FROM Person</SQL_QUERY> | network_2 | SELECT avg(age) FROM Person | What is the average age for all people in the table? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many different cities are they from?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT city) FROM Person</SQL_QUERY> | network_2 | SELECT count(DISTINCT city) FROM Person | How many different cities are they from? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many different cities do people originate from?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT city) FROM Person</SQL_QUERY> | network_2 | SELECT count(DISTINCT city) FROM Person | How many different cities do people originate from? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many type of jobs do they have?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT job) FROM Person</SQL_QUERY> | network_2 | SELECT count(DISTINCT job) FROM Person | How many type of jobs do they have? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many different jobs are listed?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT job) FROM Person</SQL_QUERY> | network_2 | SELECT count(DISTINCT job) FROM Person | How many different jobs are listed? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who is the oldest person?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE age = (SELECT max(age) FROM person) | Who is the oldest person? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the person who is the oldest?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE age = (SELECT max(age) FROM person)</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE age = (SELECT max(age) FROM person) | What is the name of the person who is the oldest? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who is the oldest person whose job is student?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' )</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' ) | Who is the oldest person whose job is student? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the oldest student?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' )</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE job = 'student' AND age = (SELECT max(age) FROM person WHERE job = 'student' ) | What is the name of the oldest student? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who is the youngest male?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' )</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' ) | Who is the youngest male? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the youngest male?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' )</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT min(age) FROM person WHERE gender = 'male' ) | What is the name of the youngest male? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How old is the doctor named Zach?</question>
[SQL]:
| <SQL_QUERY>SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'</SQL_QUERY> | network_2 | SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach' | How old is the doctor named Zach? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the age of the doctor named Zach?</question>
[SQL]:
| <SQL_QUERY>SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'</SQL_QUERY> | network_2 | SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach' | What is the age of the doctor named Zach? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who is the person whose age is below 30?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE age < 30</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE age < 30 | Who is the person whose age is below 30? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the person whose age is below 30?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE age < 30</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE age < 30 | What is the name of the person whose age is below 30? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many people whose age is greater 30 and job is engineer?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'</SQL_QUERY> | network_2 | SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer' | How many people whose age is greater 30 and job is engineer? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>HOw many engineers are older than 30?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer'</SQL_QUERY> | network_2 | SELECT count(*) FROM Person WHERE age > 30 AND job = 'engineer' | HOw many engineers are older than 30? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average age for each gender?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) , gender FROM Person GROUP BY gender</SQL_QUERY> | network_2 | SELECT avg(age) , gender FROM Person GROUP BY gender | What is the average age for each gender? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How old is each gender, on average?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) , gender FROM Person GROUP BY gender</SQL_QUERY> | network_2 | SELECT avg(age) , gender FROM Person GROUP BY gender | How old is each gender, on average? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is average age for different job title?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) , job FROM Person GROUP BY job</SQL_QUERY> | network_2 | SELECT avg(age) , job FROM Person GROUP BY job | What is average age for different job title? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How old is the average person for each job?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) , job FROM Person GROUP BY job</SQL_QUERY> | network_2 | SELECT avg(age) , job FROM Person GROUP BY job | How old is the average person for each job? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is average age of male for different job title?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job</SQL_QUERY> | network_2 | SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job | What is average age of male for different job title? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average age for a male in each job?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job</SQL_QUERY> | network_2 | SELECT avg(age) , job FROM Person WHERE gender = 'male' GROUP BY job | What is the average age for a male in each job? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is minimum age for different job title?</question>
[SQL]:
| <SQL_QUERY>SELECT min(age) , job FROM Person GROUP BY job</SQL_QUERY> | network_2 | SELECT min(age) , job FROM Person GROUP BY job | What is minimum age for different job title? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How old is the youngest person for each job?</question>
[SQL]:
| <SQL_QUERY>SELECT min(age) , job FROM Person GROUP BY job</SQL_QUERY> | network_2 | SELECT min(age) , job FROM Person GROUP BY job | How old is the youngest person for each job? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of people who is under 40 for each gender.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender</SQL_QUERY> | network_2 | SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender | Find the number of people who is under 40 for each gender. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many people are under 40 for each gender?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender</SQL_QUERY> | network_2 | SELECT count(*) , gender FROM Person WHERE age < 40 GROUP BY gender | How many people are under 40 for each gender? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of people whose age is greater than any engineer sorted by their age.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age | Find the name of people whose age is greater than any engineer sorted by their age. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of all the people who are older than at least one engineer? Order them by age.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE age > (SELECT min(age) FROM person WHERE job = 'engineer') ORDER BY age | What is the name of all the people who are older than at least one engineer? Order them by age. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of people whose age is greater than all engineers.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer')</SQL_QUERY> | network_2 | SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer') | Find the number of people whose age is greater than all engineers. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many people are older than every engineer?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer')</SQL_QUERY> | network_2 | SELECT count(*) FROM Person WHERE age > (SELECT max(age) FROM person WHERE job = 'engineer') | How many people are older than every engineer? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>list the name, job title of all people ordered by their names.</question>
[SQL]:
| <SQL_QUERY>SELECT name , job FROM Person ORDER BY name</SQL_QUERY> | network_2 | SELECT name , job FROM Person ORDER BY name | list the name, job title of all people ordered by their names. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names and job titles of every person ordered alphabetically by name?</question>
[SQL]:
| <SQL_QUERY>SELECT name , job FROM Person ORDER BY name</SQL_QUERY> | network_2 | SELECT name , job FROM Person ORDER BY name | What are the names and job titles of every person ordered alphabetically by name? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the names of all person sorted in the descending order using age.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person ORDER BY age DESC</SQL_QUERY> | network_2 | SELECT name FROM Person ORDER BY age DESC | Find the names of all person sorted in the descending order using age. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of everybody sorted by age in descending order?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person ORDER BY age DESC</SQL_QUERY> | network_2 | SELECT name FROM Person ORDER BY age DESC | What are the names of everybody sorted by age in descending order? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and age of all males in order of their age.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE gender = 'male' ORDER BY age</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE gender = 'male' ORDER BY age | Find the name and age of all males in order of their age. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name and age of every male? Order the results by age.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Person WHERE gender = 'male' ORDER BY age</SQL_QUERY> | network_2 | SELECT name FROM Person WHERE gender = 'male' ORDER BY age | What is the name and age of every male? Order the results by age. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and age of the person who is a friend of both Dan and Alice.</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | Find the name and age of the person who is a friend of both Dan and Alice. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names and ages of every person who is a friend of both Dan and Alice?</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | What are the names and ages of every person who is a friend of both Dan and Alice? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and age of the person who is a friend of Dan or Alice.</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | Find the name and age of the person who is a friend of Dan or Alice. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different names and ages of every friend of either Dan or alice?</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | What are the different names and ages of every friend of either Dan or alice? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of the person who has friends with age above 40 and under age 30?</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | network_2 | 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) | Find the name of the person who has friends with age above 40 and under age 30? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of every person who has a friend over 40 and under 30?</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | network_2 | 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) | What are the names of every person who has a friend over 40 and under 30? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of the person who has friends with age above 40 but not under age 30?</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | network_2 | 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) | Find the name of the person who has friends with age above 40 but not under age 30? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the people who are older 40 but no friends under age 30?</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | network_2 | 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) | What are the names of the people who are older 40 but no friends under age 30? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of the person who has no student friends.</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | Find the name of the person who has no student friends. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the people who have no friends who are students?</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | What are the names of the people who have no friends who are students? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the person who has exactly one friend.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1</SQL_QUERY> | network_2 | SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1 | Find the person who has exactly one friend. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of everybody who has exactly one friend?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1</SQL_QUERY> | network_2 | SELECT name FROM PersonFriend GROUP BY name HAVING count(*) = 1 | What are the names of everybody who has exactly one friend? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who are the friends of Bob?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'</SQL_QUERY> | network_2 | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob' | Who are the friends of Bob? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who are Bob's friends?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'</SQL_QUERY> | network_2 | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob' | Who are Bob's friends? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of persons who are friends with Bob.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'</SQL_QUERY> | network_2 | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob' | Find the name of persons who are friends with Bob. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all of Bob's friends?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'</SQL_QUERY> | network_2 | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob' | What are the names of all of Bob's friends? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the names of females who are friends with Zach</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'</SQL_QUERY> | network_2 | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female' | Find the names of females who are friends with Zach | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all females who are friends with Zach?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'</SQL_QUERY> | network_2 | SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female' | What are the names of all females who are friends with Zach? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the female friends of Alice.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'</SQL_QUERY> | network_2 | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female' | Find the female friends of Alice. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are all the friends of Alice who are female?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'</SQL_QUERY> | network_2 | SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female' | What are all the friends of Alice who are female? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the male friend of Alice whose job is a doctor?</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | Find the male friend of Alice whose job is a doctor? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who are the friends of Alice that are doctors?</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | Who are the friends of Alice that are doctors? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who has a friend that is from new york city?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'</SQL_QUERY> | network_2 | SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city' | Who has a friend that is from new york city? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all friends who are from New York?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'</SQL_QUERY> | network_2 | SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city' | What are the names of all friends who are from New York? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who has friends that are younger than the average age?</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | network_2 | 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) | Who has friends that are younger than the average age? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different names of friends who are younger than the average age for a friend?</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | network_2 | 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) | What are the different names of friends who are younger than the average age for a friend? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who has friends that are older than the average age? Print their friends and their ages as well</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | network_2 | 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) | Who has friends that are older than the average age? Print their friends and their ages as well | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Whare the names, friends, and ages of all people who are older than the average age of a person?</question>
[SQL]:
| <SQL_QUERY>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)</SQL_QUERY> | network_2 | 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) | Whare the names, friends, and ages of all people who are older than the average age of a person? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who is the friend of Zach with longest year relationship?</question>
[SQL]:
| <SQL_QUERY>SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')</SQL_QUERY> | network_2 | SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach') | Who is the friend of Zach with longest year relationship? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which friend of Zach has the longest-lasting friendship?</question>
[SQL]:
| <SQL_QUERY>SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach')</SQL_QUERY> | network_2 | SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT max(YEAR) FROM PersonFriend WHERE name = 'Zach') | Which friend of Zach has the longest-lasting friendship? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the age of the friend of Zach with longest year relationship?</question>
[SQL]:
| <SQL_QUERY>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')</SQL_QUERY> | network_2 | 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') | What is the age of the friend of Zach with longest year relationship? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the ages of all of Zach's friends who are in the longest relationship?</question>
[SQL]:
| <SQL_QUERY>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')</SQL_QUERY> | network_2 | 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') | What are the ages of all of Zach's friends who are in the longest relationship? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of persons who are friends with Alice for the shortest years.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice')</SQL_QUERY> | network_2 | SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice') | Find the name of persons who are friends with Alice for the shortest years. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all people who are friends with Alice for the shortest amount of time?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice')</SQL_QUERY> | network_2 | SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT min(YEAR) FROM PersonFriend WHERE friend = 'Alice') | What are the names of all people who are friends with Alice for the shortest amount of time? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name, age, and job title of persons who are friends with Alice for the longest years.</question>
[SQL]:
| <SQL_QUERY>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')</SQL_QUERY> | network_2 | 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') | Find the name, age, and job title of persons who are friends with Alice for the longest years. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time?</question>
[SQL]:
| <SQL_QUERY>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')</SQL_QUERY> | network_2 | 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') | What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who is the person that has no friend?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM person EXCEPT SELECT name FROM PersonFriend</SQL_QUERY> | network_2 | SELECT name FROM person EXCEPT SELECT name FROM PersonFriend | Who is the person that has no friend? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all people who do not have friends?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM person EXCEPT SELECT name FROM PersonFriend</SQL_QUERY> | network_2 | SELECT name FROM person EXCEPT SELECT name FROM PersonFriend | What are the names of all people who do not have friends? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which person whose friends have the oldest average age?</question>
[SQL]:
| <SQL_QUERY>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</SQL_QUERY> | network_2 | 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 | Which person whose friends have the oldest average age? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the person who has the oldest average age for their friends, and what is that average age?</question>
[SQL]:
| <SQL_QUERY>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</SQL_QUERY> | network_2 | 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 | What is the name of the person who has the oldest average age for their friends, and what is that average age? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total number of people who has no friend living in the city of Austin.</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin')</SQL_QUERY> | network_2 | SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin') | What is the total number of people who has no friend living in the city of Austin. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total number of people who have no friends living in Austin?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin')</SQL_QUERY> | network_2 | SELECT count(DISTINCT name) FROM PersonFriend WHERE friend NOT IN (SELECT name FROM person WHERE city = 'Austin') | What is the total number of people who have no friends living in Austin? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find Alice's friends of friends.</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | Find Alice's friends of friends. | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number);</schema>"
<primary_keys>[Primary Keys]: person : name</primary_keys>"
<foreign_keys>[Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all of Alice's friends of friends?</question>
[SQL]:
| <SQL_QUERY>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'</SQL_QUERY> | network_2 | 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' | What are the names of all of Alice's friends of friends? | [Schema (values) (types)]: | network_2 | Person : name (text) , age (text) , city (number) , gender (text) , job (text) | PersonFriend : name (text) , friend (text) , year (number); | [Primary Keys]: person : name | [Foreign Keys]: personfriend : friend = person : name | personfriend : name = person : name |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many members are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM member</SQL_QUERY> | decoration_competition | SELECT count(*) FROM member | How many members are there? | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the names of members in ascending alphabetical order.</question>
[SQL]:
| <SQL_QUERY>SELECT Name FROM member ORDER BY Name ASC</SQL_QUERY> | decoration_competition | SELECT Name FROM member ORDER BY Name ASC | List the names of members in ascending alphabetical order. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names and countries of members?</question>
[SQL]:
| <SQL_QUERY>SELECT Name , Country FROM member</SQL_QUERY> | decoration_competition | SELECT Name , Country FROM member | What are the names and countries of members? | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the names of members whose country is "United States" or "Canada".</question>
[SQL]:
| <SQL_QUERY>SELECT Name FROM member WHERE Country = "United States" OR Country = "Canada"</SQL_QUERY> | decoration_competition | SELECT Name FROM member WHERE Country = "United States" OR Country = "Canada" | Show the names of members whose country is "United States" or "Canada". | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the different countries and the number of members from each.</question>
[SQL]:
| <SQL_QUERY>SELECT Country , COUNT(*) FROM member GROUP BY Country</SQL_QUERY> | decoration_competition | SELECT Country , COUNT(*) FROM member GROUP BY Country | Show the different countries and the number of members from each. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the most common country across members.</question>
[SQL]:
| <SQL_QUERY>SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1</SQL_QUERY> | decoration_competition | SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 | Show the most common country across members. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which countries have more than two members?</question>
[SQL]:
| <SQL_QUERY>SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2</SQL_QUERY> | decoration_competition | SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2 | Which countries have more than two members? | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the leader names and locations of colleges.</question>
[SQL]:
| <SQL_QUERY>SELECT Leader_Name , College_Location FROM college</SQL_QUERY> | decoration_competition | SELECT Leader_Name , College_Location FROM college | Show the leader names and locations of colleges. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the names of members and names of colleges they go to.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.Name , T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID</SQL_QUERY> | decoration_competition | SELECT T2.Name , T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID | Show the names of members and names of colleges they go to. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.</question>
[SQL]:
| <SQL_QUERY>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</SQL_QUERY> | decoration_competition | 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 | Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the distinct leader names of colleges associated with members from country "Canada".</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada"</SQL_QUERY> | decoration_competition | SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada" | Show the distinct leader names of colleges associated with members from country "Canada". | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the names of members and the decoration themes they have.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Name , T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID</SQL_QUERY> | decoration_competition | SELECT T1.Name , T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID | Show the names of members and the decoration themes they have. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the names of members that have a rank in round higher than 3.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3</SQL_QUERY> | decoration_competition | SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3 | Show the names of members that have a rank in round higher than 3. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the names of members in ascending order of their rank in rounds.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round ASC</SQL_QUERY> | decoration_competition | SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round ASC | Show the names of members in ascending order of their rank in rounds. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text);</schema>"
<primary_keys>[Primary Keys]: college : college_id, member : member_id, round : member_id</primary_keys>"
<foreign_keys>[Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the names of members who did not participate in any round.</question>
[SQL]:
| <SQL_QUERY>SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM round)</SQL_QUERY> | decoration_competition | SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM round) | List the names of members who did not participate in any round. | [Schema (values) (types)]: | decoration_competition | college : college_id (text) , name (number) , leader_name (text) , college_location (text) | member : member_id (text) , name (number) , country (text) , college_id (text) | round : round_id (text) , member_id (number) , decoration_theme (text) , rank_in_round (text); | [Primary Keys]: college : college_id, member : member_id, round : member_id | [Foreign Keys]: member : college_id = college : college_id | round : member_id = member : member_id |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | document_management | Roles : role_code (text) , role_description (text) | Users : user_id (text) , role_code (text) , user_name (text) , user_login (number) , password (text) | Document_Structures : document_structure_code (text) , parent_document_structure_code (text) , document_structure_description (text) | Functional_Areas : functional_area_code (text) , parent_functional_area_code (text) , functional_area_description (text) | Images : image_id (text) , image_alt_text (text) , image_name (text) , image_url (number) | Documents : document_code (text) , document_structure_code (text) , document_type_code (text) , access_count (number) , document_name (text) | Document_Functional_Areas : document_code (text) , functional_area_code (text) | Document_Sections : section_id (text) , document_code (text) , section_sequence (text) , section_code (number) , section_title (text) | Document_Sections_Images : section_id (text) , image_id (text);</schema>"
<primary_keys>[Primary Keys]: roles : role_code, users : user_id, document_structures : document_structure_code, functional_areas : functional_area_code, images : image_id, documents : document_code, document_functional_areas : section_id, document_sections : section_id</primary_keys>"
<foreign_keys>[Foreign Keys]: 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</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and access counts of all documents, in alphabetic order of the document name.</question>
[SQL]:
| <SQL_QUERY>SELECT document_name , access_count FROM documents ORDER BY document_name</SQL_QUERY> | document_management | SELECT document_name , access_count FROM documents ORDER BY document_name | Find the name and access counts of all documents, in alphabetic order of the document name. | [Schema (values) (types)]: | document_management | Roles : role_code (text) , role_description (text) | Users : user_id (text) , role_code (text) , user_name (text) , user_login (number) , password (text) | Document_Structures : document_structure_code (text) , parent_document_structure_code (text) , document_structure_description (text) | Functional_Areas : functional_area_code (text) , parent_functional_area_code (text) , functional_area_description (text) | Images : image_id (text) , image_alt_text (text) , image_name (text) , image_url (number) | Documents : document_code (text) , document_structure_code (text) , document_type_code (text) , access_count (number) , document_name (text) | Document_Functional_Areas : document_code (text) , functional_area_code (text) | Document_Sections : section_id (text) , document_code (text) , section_sequence (text) , section_code (number) , section_title (text) | Document_Sections_Images : section_id (text) , image_id (text); | [Primary Keys]: roles : role_code, users : user_id, document_structures : document_structure_code, functional_areas : functional_area_code, images : image_id, documents : document_code, document_functional_areas : section_id, document_sections : section_id | [Foreign Keys]: 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.