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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What type of pet is the youngest animal, and how much does it weigh?</question>
[SQL]:

Output: <SQL_QUERY>SELECT pettype ,  weight FROM pets ORDER BY pet_age LIMIT 1</SQL_QUERY>

Question: SELECT pettype ,  weight FROM pets ORDER BY pet_age LIMIT 1

Question: What type of pet is the youngest animal, and how much does it weigh?


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the id and weight of all pets whose age is older than 1.</question>
[SQL]:

Output: <SQL_QUERY>SELECT petid ,  weight FROM pets WHERE pet_age  >  1</SQL_QUERY>

Question: SELECT petid ,  weight FROM pets WHERE pet_age  >  1

Question: Find the id and weight of all pets whose age is older than 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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the id and weight of every pet who is older than 1?</question>
[SQL]:

Output: <SQL_QUERY>SELECT petid ,  weight FROM pets WHERE pet_age  >  1</SQL_QUERY>

Question: SELECT petid ,  weight FROM pets WHERE pet_age  >  1

Question: What is the id and weight of every pet who is older than 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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average and maximum age for each type of pet.</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(pet_age) ,  max(pet_age) ,  pettype FROM pets GROUP BY pettype</SQL_QUERY>

Question: SELECT avg(pet_age) ,  max(pet_age) ,  pettype FROM pets GROUP BY pettype

Question: Find the average and maximum age for each type of pet.


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average and maximum age for each pet type?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(pet_age) ,  max(pet_age) ,  pettype FROM pets GROUP BY pettype</SQL_QUERY>

Question: SELECT avg(pet_age) ,  max(pet_age) ,  pettype FROM pets GROUP BY pettype

Question: What is the average and maximum age for each pet type?


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average weight for each pet type.</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(weight) ,  pettype FROM pets GROUP BY pettype</SQL_QUERY>

Question: SELECT avg(weight) ,  pettype FROM pets GROUP BY pettype

Question: Find the average weight for each pet type.


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average weight for each type of pet?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(weight) ,  pettype FROM pets GROUP BY pettype</SQL_QUERY>

Question: SELECT avg(weight) ,  pettype FROM pets GROUP BY pettype

Question: What is the average weight for each type of pet?


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and age of students who have a pet.</question>
[SQL]:

Output: <SQL_QUERY>SELECT DISTINCT T1.fname ,  T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid</SQL_QUERY>

Question: SELECT DISTINCT T1.fname ,  T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid

Question: Find the first name and age of students who have a pet.


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different first names and ages of the students who do have pets?</question>
[SQL]:

Output: <SQL_QUERY>SELECT DISTINCT T1.fname ,  T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid</SQL_QUERY>

Question: SELECT DISTINCT T1.fname ,  T1.age FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid

Question: What are the different first names and ages of the students who do have pets?


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the id of the pet owned by student whose last name is ‘Smith’.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid WHERE T1.Lname  =  'Smith'</SQL_QUERY>

Question: SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid WHERE T1.Lname  =  'Smith'

Question: Find the id of the pet owned by student whose last name is ‘Smith’.


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the id of the pet owned by the student whose last name is 'Smith'?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid WHERE T1.Lname  =  'Smith'</SQL_QUERY>

Question: SELECT T2.petid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid WHERE T1.Lname  =  'Smith'

Question: What is the id of the pet owned by the student whose last name is 'Smith'?


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the number of pets for each student who has any pet and student id.</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) ,  T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid GROUP BY T1.stuid</SQL_QUERY>

Question: SELECT count(*) ,  T1.stuid FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid GROUP BY T1.stuid

Question: Find the number of pets for each student who has any pet and student id.


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>For students who have pets , how many pets does each student have ? list their ids instead of names .</question>
[SQL]:

Output: <SQL_QUERY>select count(*) ,  t1.stuid from student as t1 join has_pet as t2 on t1.stuid  =  t2.stuid group by t1.stuid</SQL_QUERY>

Question: select count(*) ,  t1.stuid from student as t1 join has_pet as t2 on t1.stuid  =  t2.stuid group by t1.stuid

Question: For students who have pets , how many pets does each student have ? list their ids instead of names .


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the first name and gender of student who have more than one pet.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.fname ,  T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid GROUP BY T1.stuid HAVING count(*)  >  1</SQL_QUERY>

Question: SELECT T1.fname ,  T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid GROUP BY T1.stuid HAVING count(*)  >  1

Question: Find the first name and gender of student who have more than one pet.


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the first name and gender of the all the students who have more than one pet?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.fname ,  T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid GROUP BY T1.stuid HAVING count(*)  >  1</SQL_QUERY>

Question: SELECT T1.fname ,  T1.sex FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid GROUP BY T1.stuid HAVING count(*)  >  1

Question: What is the first name and gender of the all the students who have more than one pet?


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the last name of the student who has a cat that is age 3.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pet_age  =  3 AND T3.pettype  =  'cat'</SQL_QUERY>

Question: SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pet_age  =  3 AND T3.pettype  =  'cat'

Question: Find the last name of the student who has a cat that is age 3.


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the last name of the student who has a cat that is 3 years old?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pet_age  =  3 AND T3.pettype  =  'cat'</SQL_QUERY>

Question: SELECT T1.lname FROM student AS T1 JOIN has_pet AS T2 ON T1.stuid  =  T2.stuid JOIN pets AS T3 ON T3.petid  =  T2.petid WHERE T3.pet_age  =  3 AND T3.pettype  =  'cat'

Question: What is the last name of the student who has a cat that is 3 years old?


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the average age of students who do not have any pet .</question>
[SQL]:

Output: <SQL_QUERY>select avg(age) from student where stuid not in (select stuid from has_pet)</SQL_QUERY>

Question: select avg(age) from student where stuid not in (select stuid from has_pet)

Question: Find the average age of students who do not have any pet .


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)]: | pets_1 |  Student : stuid (text) , lname (number) , fname (text) , age (text) , sex (number) , major (text) , advisor (number) , city_code (number) | Has_Pet : stuid (text) , petid (number) | Pets : petid (text) , pettype (number) , pet_age (text) , weight (text);</schema>"
<primary_keys>[Primary Keys]: student : stuid, has_pet : petid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_pet : stuid = student : stuid | has_pet : petid = pets : petid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average age for all students who do not own any pets ?</question>
[SQL]:

Output: <SQL_QUERY>select avg(age) from student where stuid not in (select stuid from has_pet)</SQL_QUERY>

Question: select avg(age) from student where stuid not in (select stuid from has_pet)

Question: What is the average age for all students who do not own any pets ?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many continents are there?</question>
[SQL]:

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

Question: SELECT count(*) FROM CONTINENTS;

Question: How many continents 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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of continents?</question>
[SQL]:

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

Question: SELECT count(*) FROM CONTINENTS;

Question: What is the number of continents?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many countries does each continent have? List the continent id, continent name and the number of countries.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.ContId ,  T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.Continent GROUP BY T1.ContId;</SQL_QUERY>

Question: SELECT T1.ContId ,  T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.Continent GROUP BY T1.ContId;

Question: How many countries does each continent have? List the continent id, continent name and the number of countries.


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>For each continent, list its id, name, and how many countries it has?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.ContId ,  T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.Continent GROUP BY T1.ContId;</SQL_QUERY>

Question: SELECT T1.ContId ,  T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.Continent GROUP BY T1.ContId;

Question: For each continent, list its id, name, and how many countries it has?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many countries are listed?</question>
[SQL]:

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

Question: SELECT count(*) FROM COUNTRIES;

Question: How many countries are listed?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many countries exist?</question>
[SQL]:

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

Question: SELECT count(*) FROM COUNTRIES;

Question: How many countries exist?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many models does each car maker produce? List maker full name, id and the number.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.FullName ,  T1.Id ,  count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id;</SQL_QUERY>

Question: SELECT T1.FullName ,  T1.Id ,  count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id;

Question: How many models does each car maker produce? List maker full name, id and the number.


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the full name of each car maker, along with its id and how many models it produces?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.FullName ,  T1.Id ,  count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id;</SQL_QUERY>

Question: SELECT T1.FullName ,  T1.Id ,  count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id;

Question: What is the full name of each car maker, along with its id and how many models it produces?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which model of the car has the minimum horsepower?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id ORDER BY T2.horsepower ASC LIMIT 1;</SQL_QUERY>

Question: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id ORDER BY T2.horsepower ASC LIMIT 1;

Question: Which model of the car has the minimum horsepower?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the model of the car with the smallest amount of horsepower?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id ORDER BY T2.horsepower ASC LIMIT 1;</SQL_QUERY>

Question: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id ORDER BY T2.horsepower ASC LIMIT 1;

Question: What is the model of the car with the smallest amount of horsepower?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the model of the car whose weight is below the average weight.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.Weight  <  (SELECT avg(Weight) FROM CARS_DATA)</SQL_QUERY>

Question: SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.Weight  <  (SELECT avg(Weight) FROM CARS_DATA)

Question: Find the model of the car whose weight is below the average weight.


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the model for the car with a weight smaller than the average?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.Weight  <  (SELECT avg(Weight) FROM CARS_DATA)</SQL_QUERY>

Question: SELECT T1.model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.Weight  <  (SELECT avg(Weight) FROM CARS_DATA)

Question: What is the model for the car with a weight smaller than the average?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the name of the makers that produced some cars in the year of 1970?</question>
[SQL]:

Output: <SQL_QUERY>SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker JOIN CAR_NAMES AS T3 ON T2.model  =  T3.model JOIN CARS_DATA AS T4 ON T3.MakeId  =  T4.id WHERE T4.year  =  '1970';</SQL_QUERY>

Question: SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker JOIN CAR_NAMES AS T3 ON T2.model  =  T3.model JOIN CARS_DATA AS T4 ON T3.MakeId  =  T4.id WHERE T4.year  =  '1970';

Question: Find the name of the makers that produced some cars in the year of 1970?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the different car makers who produced a car in 1970?</question>
[SQL]:

Output: <SQL_QUERY>SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker JOIN CAR_NAMES AS T3 ON T2.model  =  T3.model JOIN CARS_DATA AS T4 ON T3.MakeId  =  T4.id WHERE T4.year  =  '1970';</SQL_QUERY>

Question: SELECT DISTINCT T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker JOIN CAR_NAMES AS T3 ON T2.model  =  T3.model JOIN CARS_DATA AS T4 ON T3.MakeId  =  T4.id WHERE T4.year  =  '1970';

Question: What is the name of the different car makers who produced a car in 1970?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Find the make and production time of the cars that were produced in the earliest year?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.Make ,  T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Year  =  (SELECT min(YEAR) FROM CARS_DATA);</SQL_QUERY>

Question: SELECT T2.Make ,  T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Year  =  (SELECT min(YEAR) FROM CARS_DATA);

Question: Find the make and production time of the cars that were produced in the earliest year?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the maker of the carr produced in the earliest year and what year was it?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.Make ,  T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Year  =  (SELECT min(YEAR) FROM CARS_DATA);</SQL_QUERY>

Question: SELECT T2.Make ,  T1.Year FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Year  =  (SELECT min(YEAR) FROM CARS_DATA);

Question: What is the maker of the carr produced in the earliest year and what year was it?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which distinct car models are the produced after 1980?</question>
[SQL]:

Output: <SQL_QUERY>SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model  =  T2.model JOIN CARS_DATA AS T3 ON T2.MakeId  =  T3.id WHERE T3.year  >  1980;</SQL_QUERY>

Question: SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model  =  T2.model JOIN CARS_DATA AS T3 ON T2.MakeId  =  T3.id WHERE T3.year  >  1980;

Question: Which distinct car models are the produced after 1980?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different models for the cards produced after 1980?</question>
[SQL]:

Output: <SQL_QUERY>SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model  =  T2.model JOIN CARS_DATA AS T3 ON T2.MakeId  =  T3.id WHERE T3.year  >  1980;</SQL_QUERY>

Question: SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.model  =  T2.model JOIN CARS_DATA AS T3 ON T2.MakeId  =  T3.id WHERE T3.year  >  1980;

Question: What are the different models for the cards produced after 1980?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many car makers are there in each continents? List the continent name and the count.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.continent JOIN car_makers AS T3 ON T2.CountryId  =  T3.Country GROUP BY T1.Continent;</SQL_QUERY>

Question: SELECT T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.continent JOIN car_makers AS T3 ON T2.CountryId  =  T3.Country GROUP BY T1.Continent;

Question: How many car makers are there in each continents? List the continent name and the count.


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of each continent and how many car makers are there in each one?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.continent JOIN car_makers AS T3 ON T2.CountryId  =  T3.Country GROUP BY T1.Continent;</SQL_QUERY>

Question: SELECT T1.Continent ,  count(*) FROM CONTINENTS AS T1 JOIN COUNTRIES AS T2 ON T1.ContId  =  T2.continent JOIN car_makers AS T3 ON T2.CountryId  =  T3.Country GROUP BY T1.Continent;

Question: What is the name of each continent and how many car makers are there in each one?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which of the countries has the most car makers? List the country name.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId GROUP BY T1.Country ORDER BY Count(*) DESC LIMIT 1;</SQL_QUERY>

Question: SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId GROUP BY T1.Country ORDER BY Count(*) DESC LIMIT 1;

Question: Which of the countries has the most car makers? List the country 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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the country with the most car makers?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId GROUP BY T1.Country ORDER BY Count(*) DESC LIMIT 1;</SQL_QUERY>

Question: SELECT T2.CountryName FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId GROUP BY T1.Country ORDER BY Count(*) DESC LIMIT 1;

Question: What is the name of the country with the most car makers?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many car models are produced by each maker ? Only list the count and the maker full name .</question>
[SQL]:

Output: <SQL_QUERY>select count(*) ,  t2.fullname from model_list as t1 join car_makers as t2 on t1.maker  =  t2.id group by t2.id;</SQL_QUERY>

Question: select count(*) ,  t2.fullname from model_list as t1 join car_makers as t2 on t1.maker  =  t2.id group by t2.id;

Question: How many car models are produced by each maker ? Only list the count and the maker full 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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of car models that are produced by each maker and what is the id and full name of each maker?</question>
[SQL]:

Output: <SQL_QUERY>SELECT Count(*) ,  T2.FullName ,  T2.id FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id GROUP BY T2.id;</SQL_QUERY>

Question: SELECT Count(*) ,  T2.FullName ,  T2.id FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id GROUP BY T2.id;

Question: What is the number of car models that are produced by each maker and what is the id and full name of each maker?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the accelerate of the car make amc hornet sportabout (sw)?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Make  =  'amc hornet sportabout (sw)';</SQL_QUERY>

Question: SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Make  =  'amc hornet sportabout (sw)';

Question: What is the accelerate of the car make amc hornet sportabout (sw)?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How much does the car accelerate that makes amc hornet sportabout (sw)?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Make  =  'amc hornet sportabout (sw)';</SQL_QUERY>

Question: SELECT T1.Accelerate FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Make  =  'amc hornet sportabout (sw)';

Question: How much does the car accelerate that makes amc hornet sportabout (sw)?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many car makers are there in france?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId WHERE T2.CountryName  =  'france';</SQL_QUERY>

Question: SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId WHERE T2.CountryName  =  'france';

Question: How many car makers are there in france?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of makers of care in France?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId WHERE T2.CountryName  =  'france';</SQL_QUERY>

Question: SELECT count(*) FROM CAR_MAKERS AS T1 JOIN COUNTRIES AS T2 ON T1.Country  =  T2.CountryId WHERE T2.CountryName  =  'france';

Question: What is the number of makers of care in France?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many car models are produced in the usa?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id JOIN COUNTRIES AS T3 ON T2.Country  =  T3.CountryId WHERE T3.CountryName  =  'usa';</SQL_QUERY>

Question: SELECT count(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id JOIN COUNTRIES AS T3 ON T2.Country  =  T3.CountryId WHERE T3.CountryName  =  'usa';

Question: How many car models are produced in 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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the count of the car models produced in the United States?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id JOIN COUNTRIES AS T3 ON T2.Country  =  T3.CountryId WHERE T3.CountryName  =  'usa';</SQL_QUERY>

Question: SELECT count(*) FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id JOIN COUNTRIES AS T3 ON T2.Country  =  T3.CountryId WHERE T3.CountryName  =  'usa';

Question: What is the count of the car models produced in the United States?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average miles per gallon(mpg) of the cars with 4 cylinders?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(mpg) FROM CARS_DATA WHERE Cylinders  =  4;</SQL_QUERY>

Question: SELECT avg(mpg) FROM CARS_DATA WHERE Cylinders  =  4;

Question: What is the average miles per gallon(mpg) of the cars with 4 cylinders?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average miles per gallon of all the cards with 4 cylinders?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(mpg) FROM CARS_DATA WHERE Cylinders  =  4;</SQL_QUERY>

Question: SELECT avg(mpg) FROM CARS_DATA WHERE Cylinders  =  4;

Question: What is the average miles per gallon of all the cards with 4 cylinders?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the smallest weight of the car produced with 8 cylinders on 1974 ?</question>
[SQL]:

Output: <SQL_QUERY>select min(weight) from cars_data where cylinders  =  8 and year  =  1974</SQL_QUERY>

Question: select min(weight) from cars_data where cylinders  =  8 and year  =  1974

Question: What is the smallest weight of the car produced with 8 cylinders on 1974 ?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the minimum weight of the car with 8 cylinders produced in 1974 ?</question>
[SQL]:

Output: <SQL_QUERY>select min(weight) from cars_data where cylinders  =  8 and year  =  1974</SQL_QUERY>

Question: select min(weight) from cars_data where cylinders  =  8 and year  =  1974

Question: What is the minimum weight of the car with 8 cylinders produced in 1974 ?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are all the makers and models?</question>
[SQL]:

Output: <SQL_QUERY>SELECT Maker ,  Model FROM MODEL_LIST;</SQL_QUERY>

Question: SELECT Maker ,  Model FROM MODEL_LIST;

Question: What are all the makers and models?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the makers and models?</question>
[SQL]:

Output: <SQL_QUERY>SELECT Maker ,  Model FROM MODEL_LIST;</SQL_QUERY>

Question: SELECT Maker ,  Model FROM MODEL_LIST;

Question: What are the makers and models?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the countries having at least one car maker? List name and id.</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.CountryName ,  T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.CountryId HAVING count(*)  >=  1;</SQL_QUERY>

Question: SELECT T1.CountryName ,  T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.CountryId HAVING count(*)  >=  1;

Question: What are the countries having at least one car maker? List name and id.


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names and ids of all countries with at least one car maker?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.CountryName ,  T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.CountryId HAVING count(*)  >=  1;</SQL_QUERY>

Question: SELECT T1.CountryName ,  T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.CountryId HAVING count(*)  >=  1;

Question: What are the names and ids of all countries with at least one car maker?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of the cars with horsepower more than 150?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM CARS_DATA WHERE horsepower  >  150;</SQL_QUERY>

Question: SELECT count(*) FROM CARS_DATA WHERE horsepower  >  150;

Question: What is the number of the cars with horsepower more than 150?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the number of cars with a horsepower greater than 150?</question>
[SQL]:

Output: <SQL_QUERY>SELECT count(*) FROM CARS_DATA WHERE horsepower  >  150;</SQL_QUERY>

Question: SELECT count(*) FROM CARS_DATA WHERE horsepower  >  150;

Question: What is the number of cars with a horsepower greater than 150?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average weight of cars each year?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(Weight) ,  YEAR FROM CARS_DATA GROUP BY YEAR;</SQL_QUERY>

Question: SELECT avg(Weight) ,  YEAR FROM CARS_DATA GROUP BY YEAR;

Question: What is the average weight of cars each year?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average weight and year for each year?</question>
[SQL]:

Output: <SQL_QUERY>SELECT avg(Weight) ,  YEAR FROM CARS_DATA GROUP BY YEAR;</SQL_QUERY>

Question: SELECT avg(Weight) ,  YEAR FROM CARS_DATA GROUP BY YEAR;

Question: What is the average weight and year for each year?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which countries in europe have at least 3 car manufacturers?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent  =  T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId  =  T3.Country WHERE T2.Continent  =  'europe' GROUP BY T1.CountryName HAVING count(*)  >=  3;</SQL_QUERY>

Question: SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent  =  T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId  =  T3.Country WHERE T2.Continent  =  'europe' GROUP BY T1.CountryName HAVING count(*)  >=  3;

Question: Which countries in europe have at least 3 car manufacturers?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all European countries with at least 3 manufacturers?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent  =  T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId  =  T3.Country WHERE T2.Continent  =  'europe' GROUP BY T1.CountryName HAVING count(*)  >=  3;</SQL_QUERY>

Question: SELECT T1.CountryName FROM COUNTRIES AS T1 JOIN CONTINENTS AS T2 ON T1.Continent  =  T2.ContId JOIN CAR_MAKERS AS T3 ON T1.CountryId  =  T3.Country WHERE T2.Continent  =  'europe' GROUP BY T1.CountryName HAVING count(*)  >=  3;

Question: What are the names of all European countries with at least 3 manufacturers?


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)]: | car_1 |  continents : contid (text) , continent (number) | countries : countryid (text) , countryname (number) , continent (text) | car_makers : id (text) , maker (number) , fullname (text) , country (number) | model_list : modelid (text) , maker (number) , model (text) | car_names : makeid (text) , model (number) , make (text) | cars_data : id (text) , mpg (number) , cylinders (text) , edispl (number) , horsepower (text) , weight (number) , accelerate (number) , year (text);</schema>"
<primary_keys>[Primary Keys]: continents : contid, countries : countryid, car_makers : id, model_list : modelid, car_names : makeid, cars_data : id</primary_keys>"
<foreign_keys>[Foreign Keys]: countries : continent = continents : contid | car_makers : country = countries : countryid | model_list : maker = car_makers : id | car_names : model = model_list : model | cars_data : id = car_names : makeid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the maximum horsepower and the make of the car models with 3 cylinders?</question>
[SQL]:

Output: <SQL_QUERY>SELECT T2.horsepower ,  T1.Make FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.cylinders  =  3 ORDER BY T2.horsepower DESC LIMIT 1;</SQL_QUERY>

Question: SELECT T2.horsepower ,  T1.Make FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.cylinders  =  3 ORDER BY T2.horsepower DESC LIMIT 1;

Question: What is the maximum horsepower and the make of the car models with 3 cylinders?