sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the ids of the faculty who don't participate in any activity.
SQL: SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which faculty do not participate in any activity? Find their faculty ids.
SQL: SELECT FacID FROM Faculty EXCEPT SELECT FacID FROM Faculty_participates_in
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the ids of all the faculty members who participate in an activity and advise a student.
SQL: SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are ids of the faculty members who not only participate in an activity but also advise a student.
SQL: SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many activities does Mark Giuliano participate in?
SQL: SELECT count(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID WHERE T1.fname  =  "Mark" AND T1.lname  =  "Giuliano"
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the number of activities Mark Giuliano is involved in.
SQL: SELECT count(*) FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID WHERE T1.fname  =  "Mark" AND T1.lname  =  "Giuliano"
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the names of all the activities Mark Giuliano participates in.
SQL: SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN Activity AS T3 ON T3.actid  =  T2.actid WHERE T1.fname  =  "Mark" AND T1.lname  =  "Giuliano"
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names of the activities Mark Giuliano is involved in
SQL: SELECT T3.activity_name FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN Activity AS T3 ON T3.actid  =  T2.actid WHERE T1.fname  =  "Mark" AND T1.lname  =  "Giuliano"
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the first and last name of all the faculty members who participated in some activity, together with the number of activities they participated in.
SQL: SELECT  T1.fname ,  T1.lname ,  count(*) ,  T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID GROUP BY T1.FacID
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the first and last name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in.
SQL: SELECT  T1.fname ,  T1.lname ,  count(*) ,  T1.FacID FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID GROUP BY T1.FacID
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show all the activity names and the number of faculty involved in each activity.
SQL: SELECT T1.activity_name ,  count(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID  =  T2.actID GROUP BY T1.actID
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many faculty members participate in each activity? Return the activity names and the number of faculty members.
SQL: SELECT T1.activity_name ,  count(*) FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID  =  T2.actID GROUP BY T1.actID
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the first and last name of the faculty participating in the most activities?
SQL: SELECT  T1.fname ,  T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the first and last name of the faculty who is involved in the largest number of activities.
SQL: SELECT  T1.fname ,  T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID GROUP BY T1.FacID ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the name of the activity that has the most faculty members involved in?
SQL: SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID  =  T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which activity has the most faculty members participating in? Find the activity name.
SQL: SELECT T1.activity_name FROM Activity AS T1 JOIN Faculty_participates_in AS T2 ON T1.actID  =  T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the ids of the students who don't participate in any activity.
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the ids of the students who are not involved in any activity
SQL: SELECT StuID FROM Student EXCEPT SELECT StuID FROM Participates_in
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the ids for all the students who participate in an activity and are under 20.
SQL: SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age  <  20
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the ids of the students who are under 20 years old and are involved in at least one activity.
SQL: SELECT StuID FROM Participates_in INTERSECT SELECT StuID FROM Student WHERE age  <  20
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the first and last name of the student participating in the most activities?
SQL: SELECT T1.fname ,  T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID  =  T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Tell me the first and last name of the student who has the most activities.
SQL: SELECT T1.fname ,  T1.lname FROM Student AS T1 JOIN Participates_in AS T2 ON T1.StuID  =  T2.StuID GROUP BY T1.StuID ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the name of the activity with the most students?
SQL: SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID  =  T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the name of the activity that has the largest number of student participants.
SQL: SELECT T1.activity_name FROM Activity AS T1 JOIN Participates_in AS T2 ON T1.actID  =  T2.actID GROUP BY T1.actID ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the first names of the faculty members who are playing Canoeing or Kayaking.
SQL: SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Canoeing' OR T3.activity_name  =  'Kayaking'
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which faculty members are playing either Canoeing or Kayaking? Tell me their first names.
SQL: SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Canoeing' OR T3.activity_name  =  'Kayaking'
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the first names of professors who are not playing Canoeing or Kayaking.
SQL: SELECT lname FROM faculty WHERE rank  =  'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Canoeing' OR T3.activity_name  =  'Kayaking'
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the first names of the professors who do not play Canoeing or Kayaking as activities?
SQL: SELECT lname FROM faculty WHERE rank  =  'Professor' EXCEPT SELECT DISTINCT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Canoeing' OR T3.activity_name  =  'Kayaking'
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the first names of the faculty members who participate in Canoeing and Kayaking.
SQL: SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Kayaking'
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the first names of the faculty members playing both Canoeing and Kayaking?
SQL: SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Canoeing' INTERSECT SELECT T1.lname FROM Faculty AS T1 JOIN Faculty_participates_in AS T2 ON T1.facID  =  T2.facID JOIN activity AS T3 ON T2.actid  =  T2.actid WHERE T3.activity_name  =  'Kayaking'
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the ids of the students who participate in Canoeing and Kayaking.
SQL: SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid  =  T2.actid WHERE T2.activity_name  =  'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid  =  T2.actid WHERE T2.activity_name  =  'Kayaking'
-- Language PostgreSQL
        -- Tables: 
             -- Table: activity 
columns : [['activity id', 'number'], ['activity name', 'text']]

 -- Table: participates in 
columns : [['student id', 'number'], ['activity id', 'number']]

 -- Table: faculty participates in 
columns : [['faculty id', 'number'], ['activity id', 'number']]

 -- Table: student 
columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']]

 -- Table: faculty 
columns : [['faculty id', 'number'], ['last name', 'text'], ['first name', 'text'], ['rank', 'text'], ['sex', 'text'], ['phone', 'number'], ['room', 'text'], ['building', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which students participate in both Canoeing and Kayaking as their activities? Tell me their student ids.
SQL: SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid  =  T2.actid WHERE T2.activity_name  =  'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid  =  T2.actid WHERE T2.activity_name  =  'Kayaking'
-- Language PostgreSQL
        -- Tables: 
             -- Table: routes 
columns : [['route id', 'number'], ['destination airport id', 'number'], ['destination airport', 'text'], ['source airport id', 'number'], ['source airport', 'text'], ['airline id', 'number'], ['airline', 'text'], ['code share', 'text']]

 -- Table: airports 
columns : [['airport id', 'number'], ['name', 'text'], ['city', 'text'], ['country', 'text'], ['x', 'number'], ['y', 'number'], ['elevation', 'number'], ['iata', 'text'], ['icao', 'text']]

 -- Table: airlines 
columns : [['airline id', 'number'], ['name', 'text'], ['iata', 'text'], ['icao', 'text'], ['call sign', 'text'], ['country', 'text'], ['active', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the name of the airport in the city of Goroka.
SQL: SELECT name FROM airports WHERE city  =  'Goroka'
-- Language PostgreSQL
        -- Tables: 
             -- Table: routes 
columns : [['route id', 'number'], ['destination airport id', 'number'], ['destination airport', 'text'], ['source airport id', 'number'], ['source airport', 'text'], ['airline id', 'number'], ['airline', 'text'], ['code share', 'text']]

 -- Table: airports 
columns : [['airport id', 'number'], ['name', 'text'], ['city', 'text'], ['country', 'text'], ['x', 'number'], ['y', 'number'], ['elevation', 'number'], ['iata', 'text'], ['icao', 'text']]

 -- Table: airlines 
columns : [['airline id', 'number'], ['name', 'text'], ['iata', 'text'], ['icao', 'text'], ['call sign', 'text'], ['country', 'text'], ['active', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names of the airports in the city of Goroka?
SQL: SELECT name FROM airports WHERE city  =  'Goroka'
-- Language PostgreSQL
        -- Tables: 
             -- Table: routes 
columns : [['route id', 'number'], ['destination airport id', 'number'], ['destination airport', 'text'], ['source airport id', 'number'], ['source airport', 'text'], ['airline id', 'number'], ['airline', 'text'], ['code share', 'text']]

 -- Table: airports 
columns : [['airport id', 'number'], ['name', 'text'], ['city', 'text'], ['country', 'text'], ['x', 'number'], ['y', 'number'], ['elevation', 'number'], ['iata', 'text'], ['icao', 'text']]

 -- Table: airlines 
columns : [['airline id', 'number'], ['name', 'text'], ['iata', 'text'], ['icao', 'text'], ['call sign', 'text'], ['country', 'text'], ['active', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the name, city, country, and altitude (or elevation) of the airports in the city of New York.
SQL: SELECT name ,  city ,  country ,  elevation FROM airports WHERE city  =  'New York'
-- Language PostgreSQL
        -- Tables: 
             -- Table: routes 
columns : [['route id', 'number'], ['destination airport id', 'number'], ['destination airport', 'text'], ['source airport id', 'number'], ['source airport', 'text'], ['airline id', 'number'], ['airline', 'text'], ['code share', 'text']]

 -- Table: airports 
columns : [['airport id', 'number'], ['name', 'text'], ['city', 'text'], ['country', 'text'], ['x', 'number'], ['y', 'number'], ['elevation', 'number'], ['iata', 'text'], ['icao', 'text']]

 -- Table: airlines 
columns : [['airline id', 'number'], ['name', 'text'], ['iata', 'text'], ['icao', 'text'], ['call sign', 'text'], ['country', 'text'], ['active', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the name, city, country, and elevation for every airport in the city of New York?
SQL: SELECT name ,  city ,  country ,  elevation FROM airports WHERE city  =  'New York'
-- Language PostgreSQL
        -- Tables: 
             -- Table: routes 
columns : [['route id', 'number'], ['destination airport id', 'number'], ['destination airport', 'text'], ['source airport id', 'number'], ['source airport', 'text'], ['airline id', 'number'], ['airline', 'text'], ['code share', 'text']]

 -- Table: airports 
columns : [['airport id', 'number'], ['name', 'text'], ['city', 'text'], ['country', 'text'], ['x', 'number'], ['y', 'number'], ['elevation', 'number'], ['iata', 'text'], ['icao', 'text']]

 -- Table: airlines 
columns : [['airline id', 'number'], ['name', 'text'], ['iata', 'text'], ['icao', 'text'], ['call sign', 'text'], ['country', 'text'], ['active', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many airlines are there?
SQL: SELECT count(*) FROM airlines