brief_instruction
stringlengths
16
224
instruction
stringlengths
687
8.77k
output
stringlengths
18
577
What is the id for the employee called Ebba?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is the id for the employee called Ebba?` to a syntactically-correct PostgreSQL query.
SELECT employee_ID FROM Employees WHERE employee_name = "Ebba"
Show the id of the employee named Ebba.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the id of the employee named Ebba.` to a syntactically-correct PostgreSQL query.
SELECT employee_ID FROM Employees WHERE employee_name = "Ebba"
Show the names of all the employees with role "HR".
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the names of all the employees with role "HR".` to a syntactically-correct PostgreSQL query.
SELECT employee_name FROM Employees WHERE role_code = "HR"
Which employees have the role with code "HR"? Find their names.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Which employees have the role with code "HR"? Find their names.` to a syntactically-correct PostgreSQL query.
SELECT employee_name FROM Employees WHERE role_code = "HR"
Show all role codes and the number of employees in each role.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show all role codes and the number of employees in each role.` to a syntactically-correct PostgreSQL query.
SELECT role_code , count(*) FROM Employees GROUP BY role_code
What is the code of each role and the number of employees in each role?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is the code of each role and the number of employees in each role?` to a syntactically-correct PostgreSQL query.
SELECT role_code , count(*) FROM Employees GROUP BY role_code
What is the role code with the largest number of employees?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is the role code with the largest number of employees?` to a syntactically-correct PostgreSQL query.
SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1
Find the code of the role that have the most employees.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Find the code of the role that have the most employees.` to a syntactically-correct PostgreSQL query.
SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) DESC LIMIT 1
Show all role codes with at least 3 employees.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show all role codes with at least 3 employees.` to a syntactically-correct PostgreSQL query.
SELECT role_code FROM Employees GROUP BY role_code HAVING count(*) >= 3
What are the roles with three or more employees? Give me the role codes.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the roles with three or more employees? Give me the role codes.` to a syntactically-correct PostgreSQL query.
SELECT role_code FROM Employees GROUP BY role_code HAVING count(*) >= 3
Show the role code with the least employees.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the role code with the least employees.` to a syntactically-correct PostgreSQL query.
SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) ASC LIMIT 1
What is the role with the smallest number of employees? Find the role codes.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is the role with the smallest number of employees? Find the role codes.` to a syntactically-correct PostgreSQL query.
SELECT role_code FROM Employees GROUP BY role_code ORDER BY count(*) ASC LIMIT 1
What is the role name and role description for employee called Ebba?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is the role name and role description for employee called Ebba?` to a syntactically-correct PostgreSQL query.
SELECT T2.role_name , T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = "Ebba"
Show the name and description of the role played by the employee named Ebba.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the name and description of the role played by the employee named Ebba.` to a syntactically-correct PostgreSQL query.
SELECT T2.role_name , T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = "Ebba"
Show the names of employees with role name Editor.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the names of employees with role name Editor.` to a syntactically-correct PostgreSQL query.
SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Editor"
Find the names of all the employees whose the role name is "Editor".
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Find the names of all the employees whose the role name is "Editor".` to a syntactically-correct PostgreSQL query.
SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Editor"
Show the employee ids for all employees with role name "Human Resource" or "Manager".
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the employee ids for all employees with role name "Human Resource" or "Manager".` to a syntactically-correct PostgreSQL query.
SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Human Resource" OR T2.role_name = "Manager"
What are the employee ids of the employees whose role name is "Human Resource" or "Manager"?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the employee ids of the employees whose role name is "Human Resource" or "Manager"?` to a syntactically-correct PostgreSQL query.
SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = "Human Resource" OR T2.role_name = "Manager"
What are the different location codes for documents?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the different location codes for documents?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT location_code FROM Document_locations
Give me all the distinct location codes for documents.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Give me all the distinct location codes for documents.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT location_code FROM Document_locations
Show the location name for document "Robin CV".
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the location name for document "Robin CV".` to a syntactically-correct PostgreSQL query.
SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = "Robin CV"
What is the location name of the document "Robin CV"?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is the location name of the document "Robin CV"?` to a syntactically-correct PostgreSQL query.
SELECT T3.location_name FROM All_documents AS T1 JOIN Document_locations AS T2 ON T1.document_id = T2.document_id JOIN Ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = "Robin CV"
Show the location code, the starting date and ending data in that location for all the documents.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the location code, the starting date and ending data in that location for all the documents.` to a syntactically-correct PostgreSQL query.
SELECT location_code , date_in_location_from , date_in_locaton_to FROM Document_locations
What are each document's location code, and starting date and ending data in that location?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are each document's location code, and starting date and ending data in that location?` to a syntactically-correct PostgreSQL query.
SELECT location_code , date_in_location_from , date_in_locaton_to FROM Document_locations
What is "the date in location from" and "the date in location to" for the document with name "Robin CV"?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is "the date in location from" and "the date in location to" for the document with name "Robin CV"?` to a syntactically-correct PostgreSQL query.
SELECT T1.date_in_location_from , T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Robin CV"
Find the starting date and ending data in location for the document named "Robin CV".
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Find the starting date and ending data in location for the document named "Robin CV".` to a syntactically-correct PostgreSQL query.
SELECT T1.date_in_location_from , T1.date_in_locaton_to FROM Document_locations AS T1 JOIN All_documents AS T2 ON T1.document_id = T2.document_id WHERE T2.document_name = "Robin CV"
Show the location codes and the number of documents in each location.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the location codes and the number of documents in each location.` to a syntactically-correct PostgreSQL query.
SELECT location_code , count(*) FROM Document_locations GROUP BY location_code
What is the code of each location and the number of documents in that location?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is the code of each location and the number of documents in that location?` to a syntactically-correct PostgreSQL query.
SELECT location_code , count(*) FROM Document_locations GROUP BY location_code
What is the location code with the most documents?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What is the location code with the most documents?` to a syntactically-correct PostgreSQL query.
SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count(*) DESC LIMIT 1
Find the code of the location with the largest number of documents.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Find the code of the location with the largest number of documents.` to a syntactically-correct PostgreSQL query.
SELECT location_code FROM Document_locations GROUP BY location_code ORDER BY count(*) DESC LIMIT 1
Show the location codes with at least 3 documents.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the location codes with at least 3 documents.` to a syntactically-correct PostgreSQL query.
SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*) >= 3
What are the codes of the locations with at least three documents?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the codes of the locations with at least three documents?` to a syntactically-correct PostgreSQL query.
SELECT location_code FROM Document_locations GROUP BY location_code HAVING count(*) >= 3
Show the location name and code with the least documents.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the location name and code with the least documents.` to a syntactically-correct PostgreSQL query.
SELECT T2.location_name , T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1
What are the name and code of the location with the smallest number of documents?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the name and code of the location with the smallest number of documents?` to a syntactically-correct PostgreSQL query.
SELECT T2.location_name , T1.location_code FROM Document_locations AS T1 JOIN Ref_locations AS T2 ON T1.location_code = T2.location_code GROUP BY T1.location_code ORDER BY count(*) ASC LIMIT 1
What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the names of the employees who authorised the destruction and the employees who destroyed the corresponding documents?` to a syntactically-correct PostgreSQL query.
SELECT T2.employee_name , T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id;
List the names of the employees who authorized the destruction of documents and the employees who destroyed the corresponding documents.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `List the names of the employees who authorized the destruction of documents and the employees who destroyed the corresponding documents.` to a syntactically-correct PostgreSQL query.
SELECT T2.employee_name , T3.employee_name FROM Documents_to_be_destroyed AS T1 JOIN Employees AS T2 ON T1.Destruction_Authorised_by_Employee_ID = T2.employee_id JOIN Employees AS T3 ON T1.Destroyed_by_Employee_ID = T3.employee_id;
Show the id of each employee and the number of document destruction authorised by that employee.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the id of each employee and the number of document destruction authorised by that employee.` to a syntactically-correct PostgreSQL query.
SELECT Destruction_Authorised_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID
What are the id of each employee and the number of document destruction authorised by that employee?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the id of each employee and the number of document destruction authorised by that employee?` to a syntactically-correct PostgreSQL query.
SELECT Destruction_Authorised_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destruction_Authorised_by_Employee_ID
Show the employee ids and the number of documents destroyed by each employee.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the employee ids and the number of documents destroyed by each employee.` to a syntactically-correct PostgreSQL query.
SELECT Destroyed_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID
What are the id of each employee and the number of document destroyed by that employee?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the id of each employee and the number of document destroyed by that employee?` to a syntactically-correct PostgreSQL query.
SELECT Destroyed_by_Employee_ID , count(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID
Show the ids of the employees who don't authorize destruction for any document.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the ids of the employees who don't authorize destruction for any document.` to a syntactically-correct PostgreSQL query.
SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
Which employees do not authorize destruction for any document? Give me their employee ids.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Which employees do not authorize destruction for any document? Give me their employee ids.` to a syntactically-correct PostgreSQL query.
SELECT employee_id FROM Employees EXCEPT SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
Show the ids of all employees who have authorized destruction.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the ids of all employees who have authorized destruction.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
What are the ids of all the employees who authorize document destruction?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the ids of all the employees who authorize document destruction?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
Show the ids of all employees who have destroyed a document.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the ids of all employees who have destroyed a document.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
What are the ids of all the employees who have destroyed documents?
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `What are the ids of all the employees who have destroyed documents?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
Show the ids of all employees who don't destroy any document.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the ids of all employees who don't destroy any document.` to a syntactically-correct PostgreSQL query.
SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
Which employees do not destroy any document? Find their employee ids.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Which employees do not destroy any document? Find their employee ids.` to a syntactically-correct PostgreSQL query.
SELECT employee_id FROM Employees EXCEPT SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed
Show the ids of all employees who have either destroyed a document or made an authorization to do this.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Show the ids of all employees who have either destroyed a document or made an authorization to do this.` to a syntactically-correct PostgreSQL query.
SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
Which employees have either destroyed a document or made an authorization to do so? Return their employee ids.
-- Language PostgreSQL -- Tables: -- Table: reference document types columns : [['document type code', 'text'], ['document type name', 'text'], ['document type description', 'text']] -- Table: reference calendar columns : [['calendar date', 'time'], ['day number', 'number']] -- Table: reference locations columns : [['location code', 'text'], ['location name', 'text'], ['location description', 'text']] -- Table: roles columns : [['role code', 'text'], ['role name', 'text'], ['role description', 'text']] -- Table: all documents columns : [['document id', 'number'], ['date stored', 'time'], ['document type code', 'text'], ['document name', 'text'], ['document description', 'text'], ['other details', 'text']] -- Table: employees columns : [['employee id', 'number'], ['role code', 'text'], ['employee name', 'text'], ['gender mfu', 'text'], ['date of birth', 'time'], ['other details', 'text']] -- Table: document locations columns : [['document id', 'number'], ['location code', 'text'], ['date in location from', 'time'], ['date in locaton to', 'time']] -- Table: documents to be destroyed columns : [['document id', 'number'], ['destruction authorised by employee id', 'number'], ['destroyed by employee id', 'number'], ['planned destruction date', 'time'], ['actual destruction date', 'time'], ['other details', '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. Translate `Which employees have either destroyed a document or made an authorization to do so? Return their employee ids.` to a syntactically-correct PostgreSQL query.
SELECT Destroyed_by_Employee_ID FROM Documents_to_be_destroyed UNION SELECT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
How many clubs are there?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `How many clubs are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club
Count the total number of clubs.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Count the total number of clubs.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club
What are the names of all clubs?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `What are the names of all clubs?` to a syntactically-correct PostgreSQL query.
SELECT clubname FROM club
Give me the name of each club.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Give me the name of each club.` to a syntactically-correct PostgreSQL query.
SELECT clubname FROM club
How many students are there?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `How many students are there?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM student
Count the total number of students.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Count the total number of students.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM student
What are the first names of all the students?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `What are the first names of all the students?` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT fname FROM student
Find each student's first name.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find each student's first name.` to a syntactically-correct PostgreSQL query.
SELECT DISTINCT fname FROM student
Find the last names of the members of the club "Bootup Baltimore".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the last names of the members of the club "Bootup Baltimore".` to a syntactically-correct PostgreSQL query.
SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore"
Who are the members of the club named "Bootup Baltimore"? Give me their last names.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Who are the members of the club named "Bootup Baltimore"? Give me their last names.` to a syntactically-correct PostgreSQL query.
SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore"
Who are the members of the club named "Hopkins Student Enterprises"? Show the last name.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Who are the members of the club named "Hopkins Student Enterprises"? Show the last name.` to a syntactically-correct PostgreSQL query.
SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises"
Return the last name for the members of the club named "Hopkins Student Enterprises".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Return the last name for the members of the club named "Hopkins Student Enterprises".` to a syntactically-correct PostgreSQL query.
SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises"
How many members does the club "Tennis Club" has?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `How many members does the club "Tennis Club" has?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Tennis Club"
Count the members of the club "Tennis Club".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Count the members of the club "Tennis Club".` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Tennis Club"
Find the number of members of club "Pen and Paper Gaming".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the number of members of club "Pen and Paper Gaming".` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Pen and Paper Gaming"
How many people have membership in the club "Pen and Paper Gaming"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `How many people have membership in the club "Pen and Paper Gaming"?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Pen and Paper Gaming"
How many clubs does "Linda Smith" belong to?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `How many clubs does "Linda Smith" belong to?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith"
How many clubs does "Linda Smith" have membership for?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `How many clubs does "Linda Smith" have membership for?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith"
Find the number of clubs where "Tracy Kim" is a member.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the number of clubs where "Tracy Kim" is a member.` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Tracy" AND t3.lname = "Kim"
For how many clubs is "Tracy Kim" a member?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `For how many clubs is "Tracy Kim" a member?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Tracy" AND t3.lname = "Kim"
Find all the female members of club "Bootup Baltimore". Show the first name and last name.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find all the female members of club "Bootup Baltimore". Show the first name and last name.` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.sex = "F"
Give me the first name and last name for all the female members of the club "Bootup Baltimore".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Give me the first name and last name for all the female members of the club "Bootup Baltimore".` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.sex = "F"
Find all the male members of club "Hopkins Student Enterprises". Show the first name and last name.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find all the male members of club "Hopkins Student Enterprises". Show the first name and last name.` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M"
What are the first name and last name of each male member in club "Hopkins Student Enterprises"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `What are the first name and last name of each male member in club "Hopkins Student Enterprises"?` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t3.sex = "M"
Find all members of "Bootup Baltimore" whose major is "600". Show the first name and last name.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find all members of "Bootup Baltimore" whose major is "600". Show the first name and last name.` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.major = "600"
Which members of "Bootup Baltimore" major in "600"? Give me their first names and last names.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Which members of "Bootup Baltimore" major in "600"? Give me their first names and last names.` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.major = "600"
Which club has the most members majoring in "600"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Which club has the most members majoring in "600"?` to a syntactically-correct PostgreSQL query.
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = "600" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
Find the club which has the largest number of members majoring in "600".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the club which has the largest number of members majoring in "600".` to a syntactically-correct PostgreSQL query.
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.major = "600" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
Find the name of the club that has the most female students.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the name of the club that has the most female students.` to a syntactically-correct PostgreSQL query.
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
Which club has the most female students as their members? Give me the name of the club.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Which club has the most female students as their members? Give me the name of the club.` to a syntactically-correct PostgreSQL query.
SELECT t1.clubname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.sex = "F" GROUP BY t1.clubname ORDER BY count(*) DESC LIMIT 1
What is the description of the club named "Tennis Club"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `What is the description of the club named "Tennis Club"?` to a syntactically-correct PostgreSQL query.
SELECT clubdesc FROM club WHERE clubname = "Tennis Club"
Find the description of the club called "Tennis Club".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the description of the club called "Tennis Club".` to a syntactically-correct PostgreSQL query.
SELECT clubdesc FROM club WHERE clubname = "Tennis Club"
Find the description of the club "Pen and Paper Gaming".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the description of the club "Pen and Paper Gaming".` to a syntactically-correct PostgreSQL query.
SELECT clubdesc FROM club WHERE clubname = "Pen and Paper Gaming"
What is the description of the club "Pen and Paper Gaming"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `What is the description of the club "Pen and Paper Gaming"?` to a syntactically-correct PostgreSQL query.
SELECT clubdesc FROM club WHERE clubname = "Pen and Paper Gaming"
What is the location of the club named "Tennis Club"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `What is the location of the club named "Tennis Club"?` to a syntactically-correct PostgreSQL query.
SELECT clublocation FROM club WHERE clubname = "Tennis Club"
Where us the club named "Tennis Club" located?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Where us the club named "Tennis Club" located?` to a syntactically-correct PostgreSQL query.
SELECT clublocation FROM club WHERE clubname = "Tennis Club"
Find the location of the club "Pen and Paper Gaming".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the location of the club "Pen and Paper Gaming".` to a syntactically-correct PostgreSQL query.
SELECT clublocation FROM club WHERE clubname = "Pen and Paper Gaming"
Where is the club "Pen and Paper Gaming" located?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Where is the club "Pen and Paper Gaming" located?` to a syntactically-correct PostgreSQL query.
SELECT clublocation FROM club WHERE clubname = "Pen and Paper Gaming"
Where is the club "Hopkins Student Enterprises" located?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Where is the club "Hopkins Student Enterprises" located?` to a syntactically-correct PostgreSQL query.
SELECT clublocation FROM club WHERE clubname = "Hopkins Student Enterprises"
Tell me the location of the club "Hopkins Student Enterprises".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Tell me the location of the club "Hopkins Student Enterprises".` to a syntactically-correct PostgreSQL query.
SELECT clublocation FROM club WHERE clubname = "Hopkins Student Enterprises"
Find the name of all the clubs at "AKW".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the name of all the clubs at "AKW".` to a syntactically-correct PostgreSQL query.
SELECT clubname FROM club WHERE clublocation = "AKW"
Which clubs are located at "AKW"? Return the club names.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Which clubs are located at "AKW"? Return the club names.` to a syntactically-correct PostgreSQL query.
SELECT clubname FROM club WHERE clublocation = "AKW"
How many clubs are located at "HHH"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `How many clubs are located at "HHH"?` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club WHERE clublocation = "HHH"
Count the number of clubs located at "HHH".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Count the number of clubs located at "HHH".` to a syntactically-correct PostgreSQL query.
SELECT count(*) FROM club WHERE clublocation = "HHH"
What are the first and last name of the president of the club "Bootup Baltimore"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `What are the first and last name of the president of the club "Bootup Baltimore"?` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t2.position = "President"
Who is the president of the club "Bootup Baltimore"? Give me the first and last name.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Who is the president of the club "Bootup Baltimore"? Give me the first and last name.` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t2.position = "President"
Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name.
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Who is the "CTO" of club "Hopkins Student Enterprises"? Show the first name and last name.` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t2.position = "CTO"
Find the first name and last name for the "CTO" of the club "Hopkins Student Enterprises"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Find the first name and last name for the "CTO" of the club "Hopkins Student Enterprises"?` to a syntactically-correct PostgreSQL query.
SELECT t3.fname , t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises" AND t2.position = "CTO"
How many different roles are there in the club "Bootup Baltimore"?
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `How many different roles are there in the club "Bootup Baltimore"?` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore"
Count the number of different positions in the club "Bootup Baltimore".
-- Language PostgreSQL -- Tables: -- Table: student columns : [['student id', 'number'], ['last name', 'text'], ['first name', 'text'], ['age', 'number'], ['sex', 'text'], ['major', 'number'], ['advisor', 'number'], ['city code', 'text']] -- Table: club columns : [['club id', 'number'], ['club name', 'text'], ['club description', 'text'], ['club location', 'text']] -- Table: member of club columns : [['student id', 'number'], ['club id', 'number'], ['position', '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. Translate `Count the number of different positions in the club "Bootup Baltimore".` to a syntactically-correct PostgreSQL query.
SELECT count(DISTINCT t2.position) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid WHERE t1.clubname = "Bootup Baltimore"