Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the towns from which at least two teachers come from?</question>
[SQL]:

Output: <SQL_QUERY>SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*)  >=  2</SQL_QUERY>

Question: SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*)  >=  2

Question: What are the towns from which at least two teachers come from?


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names of teachers and the courses they are arranged to teach.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T3.Name ,  T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID</SQL_QUERY>

Question: SELECT T3.Name ,  T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID

Question: Show names of teachers and the courses they are arranged to teach.


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of each teacher and what course they teach?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T3.Name ,  T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID</SQL_QUERY>

Question: SELECT T3.Name ,  T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID

Question: What is the name of each teacher and what course they teach?


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names of teachers and the courses they are arranged to teach in ascending alphabetical order of the teacher's name.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T3.Name ,  T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID ORDER BY T3.Name</SQL_QUERY>

Question: SELECT T3.Name ,  T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID ORDER BY T3.Name

Question: Show names of teachers and the courses they are arranged to teach in ascending alphabetical order of the teacher's name.


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the teachers and the courses they teach in ascending alphabetical order by the name of the teacher?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T3.Name ,  T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID ORDER BY T3.Name</SQL_QUERY>

Question: SELECT T3.Name ,  T2.Course FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID ORDER BY T3.Name

Question: What are the names of the teachers and the courses they teach in ascending alphabetical order by the name of the teacher?


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the name of the teacher for the math course.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID WHERE T2.Course  =  "Math"</SQL_QUERY>

Question: SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID WHERE T2.Course  =  "Math"

Question: Show the name of the teacher for the math course.


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the people who teach math courses?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID WHERE T2.Course  =  "Math"</SQL_QUERY>

Question: SELECT T3.Name FROM course_arrange AS T1 JOIN course AS T2 ON T1.Course_ID  =  T2.Course_ID JOIN teacher AS T3 ON T1.Teacher_ID  =  T3.Teacher_ID WHERE T2.Course  =  "Math"

Question: What are the names of the people who teach math courses?


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names of teachers and the number of courses they teach.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.Name ,  COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name</SQL_QUERY>

Question: SELECT T2.Name ,  COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name

Question: Show names of teachers and the number of courses they teach.


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the teachers and how many courses do they teach?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.Name ,  COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name</SQL_QUERY>

Question: SELECT T2.Name ,  COUNT(*) FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name

Question: What are the names of the teachers and how many courses do they teach?


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names of teachers that teach at least two courses.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2</SQL_QUERY>

Question: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2

Question: Show names of teachers that teach at least two courses.


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the teachers who teach at least two courses?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2</SQL_QUERY>

Question: SELECT T2.Name FROM course_arrange AS T1 JOIN teacher AS T2 ON T1.Teacher_ID  =  T2.Teacher_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2

Question: What are the names of the teachers who teach at least two courses?


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the names of teachers who have not been arranged to teach courses.</question>
[SQL]:

Output: <SQL_QUERY>SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)</SQL_QUERY>

Question: SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)

Question: List the names of teachers who have not been arranged to teach courses.


Input:
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)]: | course_teach |  course : course_id (text) , staring_date (number) , course (text) | teacher : teacher_id (text) , name (number) , age (text) , hometown (text) | course_arrange : course_id (text) , teacher_id (number) , grade (text);</schema>"
<primary_keys>[Primary Keys]: course : course_id, teacher : teacher_id, course_arrange : course_id</primary_keys>"
<foreign_keys>[Foreign Keys]: course_arrange : teacher_id = teacher : teacher_id | course_arrange : course_id = course : course_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the teachers whose courses have not been arranged?</question>
[SQL]:

Output: <SQL_QUERY>SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)</SQL_QUERY>

Question: SELECT Name FROM teacher WHERE Teacher_id NOT IN (SELECT Teacher_id FROM course_arrange)

Question: What are the names of the teachers whose courses have not been arranged?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many visitors below age 30 are there?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM visitor WHERE age  <  30</SQL_QUERY>

Question: SELECT count(*) FROM visitor WHERE age  <  30

Question: How many visitors below age 30 are there?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the names of the visitors whose membership level is higher than 4, and order the results by the level from high to low.</question>
[SQL]:

Output: <SQL_QUERY>SELECT name FROM visitor WHERE Level_of_membership  >  4 ORDER BY Level_of_membership DESC</SQL_QUERY>

Question: SELECT name FROM visitor WHERE Level_of_membership  >  4 ORDER BY Level_of_membership DESC

Question: Find the names of the visitors whose membership level is higher than 4, and order the results by the level from high to low.


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average age of the visitors whose membership level is not higher than 4?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(age) FROM visitor WHERE Level_of_membership  <=  4</SQL_QUERY>

Question: SELECT avg(age) FROM visitor WHERE Level_of_membership  <=  4

Question: What is the average age of the visitors whose membership level is not higher than 4?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and membership level of the visitors whose membership level is higher than 4, and sort by their age from old to young.</question>
[SQL]:

Output: <SQL_QUERY>SELECT name ,  Level_of_membership FROM visitor WHERE Level_of_membership  >  4 ORDER BY age DESC</SQL_QUERY>

Question: SELECT name ,  Level_of_membership FROM visitor WHERE Level_of_membership  >  4 ORDER BY age DESC

Question: Find the name and membership level of the visitors whose membership level is higher than 4, and sort by their age from old to young.


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the id and name of the museum that has the most staff members?</question>
[SQL]:

Output: <SQL_QUERY>SELECT museum_id ,  name FROM museum ORDER BY num_of_staff DESC LIMIT 1</SQL_QUERY>

Question: SELECT museum_id ,  name FROM museum ORDER BY num_of_staff DESC LIMIT 1

Question: Find the id and name of the museum that has the most staff members?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average number of staff working for the museums that were open before 2009.</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(num_of_staff) FROM museum WHERE open_year  <  2009</SQL_QUERY>

Question: SELECT avg(num_of_staff) FROM museum WHERE open_year  <  2009

Question: Find the average number of staff working for the museums that were open before 2009.


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the opening year and staff number of the museum named Plaza Museum?</question>
[SQL]:

Output: <SQL_QUERY>SELECT Num_of_Staff ,  Open_Year FROM museum WHERE name  =  'Plaza Museum'</SQL_QUERY>

Question: SELECT Num_of_Staff ,  Open_Year FROM museum WHERE name  =  'Plaza Museum'

Question: What are the opening year and staff number of the museum named Plaza Museum?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>find the names of museums which have more staff than the minimum staff number of all museums opened after 2010.</question>
[SQL]:

Output: <SQL_QUERY>SELECT name FROM museum WHERE num_of_staff  >  (SELECT min(num_of_staff) FROM museum WHERE open_year  >  2010)</SQL_QUERY>

Question: SELECT name FROM museum WHERE num_of_staff  >  (SELECT min(num_of_staff) FROM museum WHERE open_year  >  2010)

Question: find the names of museums which have more staff than the minimum staff number of all museums opened after 2010.


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>find the id, name and age for visitors who visited some museums more than once.</question>
[SQL]:

Output: <SQL_QUERY>SELECT t1.id ,  t1.name ,  t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id GROUP BY t1.id HAVING count(*)  >  1</SQL_QUERY>

Question: SELECT t1.id ,  t1.name ,  t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id GROUP BY t1.id HAVING count(*)  >  1

Question: find the id, name and age for visitors who visited some museums more than once.


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the id, name and membership level of visitors who have spent the largest amount of money in total in all museum tickets?</question>
[SQL]:

Output: <SQL_QUERY>SELECT t2.visitor_id ,  t1.name ,  t1.Level_of_membership FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id GROUP BY t2.visitor_id ORDER BY sum(t2.Total_spent) DESC LIMIT 1</SQL_QUERY>

Question: SELECT t2.visitor_id ,  t1.name ,  t1.Level_of_membership FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id GROUP BY t2.visitor_id ORDER BY sum(t2.Total_spent) DESC LIMIT 1

Question: What are the id, name and membership level of visitors who have spent the largest amount of money in total in all museum tickets?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the id and name of the museum visited most times?</question>
[SQL]:

Output: <SQL_QUERY>SELECT t2.Museum_ID ,  t1.name FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID  =  t2.Museum_ID GROUP BY t2.Museum_ID ORDER BY count(*) DESC LIMIT 1</SQL_QUERY>

Question: SELECT t2.Museum_ID ,  t1.name FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID  =  t2.Museum_ID GROUP BY t2.Museum_ID ORDER BY count(*) DESC LIMIT 1

Question: What are the id and name of the museum visited most times?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the museum that had no visitor yet?</question>
[SQL]:

Output: <SQL_QUERY>SELECT name FROM museum WHERE Museum_ID NOT IN (SELECT museum_id FROM visit)</SQL_QUERY>

Question: SELECT name FROM museum WHERE Museum_ID NOT IN (SELECT museum_id FROM visit)

Question: What is the name of the museum that had no visitor yet?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name and age of the visitor who bought the most tickets at once.</question>
[SQL]:

Output: <SQL_QUERY>SELECT t1.name ,  t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id ORDER BY t2.num_of_ticket DESC LIMIT 1</SQL_QUERY>

Question: SELECT t1.name ,  t1.age FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id ORDER BY t2.num_of_ticket DESC LIMIT 1

Question: Find the name and age of the visitor who bought the most tickets at once.


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the average and maximum number of tickets bought in all visits?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(num_of_ticket) ,  max(num_of_ticket) FROM visit</SQL_QUERY>

Question: SELECT avg(num_of_ticket) ,  max(num_of_ticket) FROM visit

Question: What are the average and maximum number of tickets bought in all visits?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total ticket expense of the visitors whose membership level is 1?</question>
[SQL]:

Output: <SQL_QUERY>SELECT sum(t2.Total_spent) FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id WHERE t1.Level_of_membership  =  1</SQL_QUERY>

Question: SELECT sum(t2.Total_spent) FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id WHERE t1.Level_of_membership  =  1

Question: What is the total ticket expense of the visitors whose membership level is 1?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the visitor who visited both a museum opened before 2009 and a museum opened after 2011?</question>
[SQL]:

Output: <SQL_QUERY>SELECT t1.name FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id JOIN museum AS t3 ON t3.Museum_ID  =  t2.Museum_ID WHERE t3.open_year  <  2009 INTERSECT SELECT t1.name FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id JOIN museum AS t3 ON t3.Museum_ID  =  t2.Museum_ID WHERE t3.open_year  >  2011</SQL_QUERY>

Question: SELECT t1.name FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id JOIN museum AS t3 ON t3.Museum_ID  =  t2.Museum_ID WHERE t3.open_year  <  2009 INTERSECT SELECT t1.name FROM visitor AS t1 JOIN visit AS t2 ON t1.id  =  t2.visitor_id JOIN museum AS t3 ON t3.Museum_ID  =  t2.Museum_ID WHERE t3.open_year  >  2011

Question: What is the name of the visitor who visited both a museum opened before 2009 and a museum opened after 2011?


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of visitors who did not visit any museum opened after 2010.</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM visitor WHERE id NOT IN (SELECT t2.visitor_id FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID  =  t2.Museum_ID WHERE t1.open_year  >  2010)</SQL_QUERY>

Question: SELECT count(*) FROM visitor WHERE id NOT IN (SELECT t2.visitor_id FROM museum AS t1 JOIN visit AS t2 ON t1.Museum_ID  =  t2.Museum_ID WHERE t1.open_year  >  2010)

Question: Find the number of visitors who did not visit any museum opened after 2010.


Input:
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)]: | museum_visit |  museum : museum_id (text) , name (number) , num_of_staff (text) , open_year (number) | visitor : id (text) , name (number) , level_of_membership (text) , age (number) | visit : museum_id (text) , visitor_id (number) , num_of_ticket (text) , total_spent (number);</schema>"
<primary_keys>[Primary Keys]: museum : museum_id, visitor : id, visit : museum_id</primary_keys>"
<foreign_keys>[Foreign Keys]: visit : visitor_id = visitor : id | visit : museum_id = museum : museum_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many museums were opened after 2013 or before 2008?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM museum WHERE open_year  >  2013 OR open_year  <  2008</SQL_QUERY>

Question: SELECT count(*) FROM museum WHERE open_year  >  2013 OR open_year  <  2008

Question: How many museums were opened after 2013 or before 2008?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the total number of players.</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM players</SQL_QUERY>

Question: SELECT count(*) FROM players

Question: Find the total number of players.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many players are there?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM players</SQL_QUERY>

Question: SELECT count(*) FROM players

Question: How many players are there?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the total number of matches.</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM matches</SQL_QUERY>

Question: SELECT count(*) FROM matches

Question: Find the total number of matches.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Count the number of matches.</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM matches</SQL_QUERY>

Question: SELECT count(*) FROM matches

Question: Count the number of matches.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the first name and birth date of all players from the country with code USA.</question>
[SQL]:

Output: <SQL_QUERY>SELECT first_name ,  birth_date FROM players WHERE country_code  =  'USA'</SQL_QUERY>

Question: SELECT first_name ,  birth_date FROM players WHERE country_code  =  'USA'

Question: List the first name and birth date of all players from the country with code USA.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names and birth dates of players from the USA?</question>
[SQL]:

Output: <SQL_QUERY>SELECT first_name ,  birth_date FROM players WHERE country_code  =  'USA'</SQL_QUERY>

Question: SELECT first_name ,  birth_date FROM players WHERE country_code  =  'USA'

Question: What are the first names and birth dates of players from the USA?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average age of losers and winners of all matches.</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(loser_age) ,  avg(winner_age) FROM matches</SQL_QUERY>

Question: SELECT avg(loser_age) ,  avg(winner_age) FROM matches

Question: Find the average age of losers and winners of all matches.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the average ages of losers and winners across matches?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(loser_age) ,  avg(winner_age) FROM matches</SQL_QUERY>

Question: SELECT avg(loser_age) ,  avg(winner_age) FROM matches

Question: What are the average ages of losers and winners across matches?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average rank of winners in all matches.</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(winner_rank) FROM matches</SQL_QUERY>

Question: SELECT avg(winner_rank) FROM matches

Question: Find the average rank of winners in all matches.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average rank for winners in all matches?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(winner_rank) FROM matches</SQL_QUERY>

Question: SELECT avg(winner_rank) FROM matches

Question: What is the average rank for winners in all matches?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the highest rank of losers in all matches.</question>
[SQL]:

Output: <SQL_QUERY>SELECT min(loser_rank) FROM matches</SQL_QUERY>

Question: SELECT min(loser_rank) FROM matches

Question: Find the highest rank of losers in all matches.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the best rank of losers across all matches?</question>
[SQL]:

Output: <SQL_QUERY>SELECT min(loser_rank) FROM matches</SQL_QUERY>

Question: SELECT min(loser_rank) FROM matches

Question: What is the best rank of losers across all matches?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>find the number of distinct country codes of all players.</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(DISTINCT country_code) FROM players</SQL_QUERY>

Question: SELECT count(DISTINCT country_code) FROM players

Question: find the number of distinct country codes of all players.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many distinct countries do players come from?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(DISTINCT country_code) FROM players</SQL_QUERY>

Question: SELECT count(DISTINCT country_code) FROM players

Question: How many distinct countries do players come from?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of distinct name of losers.</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(DISTINCT loser_name) FROM matches</SQL_QUERY>

Question: SELECT count(DISTINCT loser_name) FROM matches

Question: Find the number of distinct name of losers.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many different loser names are there?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(DISTINCT loser_name) FROM matches</SQL_QUERY>

Question: SELECT count(DISTINCT loser_name) FROM matches

Question: How many different loser names are there?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of tourney that has more than 10 matches.</question>
[SQL]:

Output: <SQL_QUERY>SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*)  >  10</SQL_QUERY>

Question: SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*)  >  10

Question: Find the name of tourney that has more than 10 matches.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of tournaments that have more than 10 matches?</question>
[SQL]:

Output: <SQL_QUERY>SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*)  >  10</SQL_QUERY>

Question: SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*)  >  10

Question: What are the names of tournaments that have more than 10 matches?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the names of all winners who played in both 2013 and 2016.</question>
[SQL]:

Output: <SQL_QUERY>SELECT winner_name FROM matches WHERE YEAR  =  2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR  =  2016</SQL_QUERY>

Question: SELECT winner_name FROM matches WHERE YEAR  =  2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR  =  2016

Question: List the names of all winners who played in both 2013 and 2016.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of players who won in both 2013 and 2016?</question>
[SQL]:

Output: <SQL_QUERY>SELECT winner_name FROM matches WHERE YEAR  =  2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR  =  2016</SQL_QUERY>

Question: SELECT winner_name FROM matches WHERE YEAR  =  2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR  =  2016

Question: What are the names of players who won in both 2013 and 2016?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the number of all matches who played in years of 2013 or 2016.</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM matches WHERE YEAR  =  2013 OR YEAR  =  2016</SQL_QUERY>

Question: SELECT count(*) FROM matches WHERE YEAR  =  2013 OR YEAR  =  2016

Question: List the number of all matches who played in years of 2013 or 2016.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many matches were played in 2013 or 2016?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM matches WHERE YEAR  =  2013 OR YEAR  =  2016</SQL_QUERY>

Question: SELECT count(*) FROM matches WHERE YEAR  =  2013 OR YEAR  =  2016

Question: How many matches were played in 2013 or 2016?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the country code and first name of the players who won in both tourney WTA Championships and Australian Open?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'WTA Championships' INTERSECT SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'Australian Open'</SQL_QUERY>

Question: SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'WTA Championships' INTERSECT SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'Australian Open'

Question: What are the country code and first name of the players who won in both tourney WTA Championships and Australian Open?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the first names and country codes for players who won both the WTA Championships and the Australian Open?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'WTA Championships' INTERSECT SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'Australian Open'</SQL_QUERY>

Question: SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'WTA Championships' INTERSECT SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'Australian Open'

Question: What are the first names and country codes for players who won both the WTA Championships and the Australian Open?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and country code of the oldest player.</question>
[SQL]:

Output: <SQL_QUERY>SELECT first_name ,  country_code FROM players ORDER BY birth_date LIMIT 1</SQL_QUERY>

Question: SELECT first_name ,  country_code FROM players ORDER BY birth_date LIMIT 1

Question: Find the first name and country code of the oldest player.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the first name and country code of the oldest player?</question>
[SQL]:

Output: <SQL_QUERY>SELECT first_name ,  country_code FROM players ORDER BY birth_date LIMIT 1</SQL_QUERY>

Question: SELECT first_name ,  country_code FROM players ORDER BY birth_date LIMIT 1

Question: What is the first name and country code of the oldest player?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the first and last name of all players in the order of birth date.</question>
[SQL]:

Output: <SQL_QUERY>SELECT first_name ,  last_name FROM players ORDER BY birth_date</SQL_QUERY>

Question: SELECT first_name ,  last_name FROM players ORDER BY birth_date

Question: List the first and last name of all players in the order of birth date.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the full names of all players, sorted by birth date?</question>
[SQL]:

Output: <SQL_QUERY>SELECT first_name ,  last_name FROM players ORDER BY birth_date</SQL_QUERY>

Question: SELECT first_name ,  last_name FROM players ORDER BY birth_date

Question: What are the full names of all players, sorted by birth date?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>List the first and last name of all players who are left / L hand in the order of birth date.</question>
[SQL]:

Output: <SQL_QUERY>SELECT first_name ,  last_name FROM players WHERE hand  =  'L' ORDER BY birth_date</SQL_QUERY>

Question: SELECT first_name ,  last_name FROM players WHERE hand  =  'L' ORDER BY birth_date

Question: List the first and last name of all players who are left / L hand in the order of birth date.


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the full names of all left handed players, in order of birth date?</question>
[SQL]:

Output: <SQL_QUERY>SELECT first_name ,  last_name FROM players WHERE hand  =  'L' ORDER BY birth_date</SQL_QUERY>

Question: SELECT first_name ,  last_name FROM players WHERE hand  =  'L' ORDER BY birth_date

Question: What are the full names of all left handed players, in order of birth date?


Input:
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)]: | wta_1 |  players : player_id (text) , first_name (number) , last_name (text) , hand (text) , birth_date (text) , country_code (time) | matches : best_of (text) , draw_size (number) , loser_age (text) , loser_entry (text) , loser_hand (text) , loser_ht (time) , loser_id (text) , loser_ioc (number) , loser_name (number) , loser_rank (number) , loser_rank_points (text) , loser_seed (text) , match_num (number) , minutes (number) , round (text) , score (text) , surface (number) , tourney_date (number) , tourney_id (number) , tourney_level (number) , tourney_name (number) , winner_age (text) , winner_entry (text) , winner_hand (text) , winner_ht (time) , winner_id (text) , winner_ioc (text) , winner_name (text) , winner_rank (number) , winner_rank_points (text) , winner_seed (text) , year (number) | rankings : ranking_date (text) , ranking (number) , player_id (text) , ranking_points (text) , tours (text);</schema>"
<primary_keys>[Primary Keys]: players : player_id</primary_keys>"
<foreign_keys>[Foreign Keys]: matches : winner_id = players : player_id | matches : loser_id = players : player_id | rankings : player_id = players : player_id</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and country code of the player who did the most number of tours.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id ORDER BY T2.tours DESC LIMIT 1</SQL_QUERY>

Question: SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id ORDER BY T2.tours DESC LIMIT 1

Question: Find the first name and country code of the player who did the most number of tours.