sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: Return the last name of the staff member who handled the complaint with the earliest date raised.
SQL: SELECT t1.last_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id ORDER BY t2.date_complaint_raised LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: How many distinct complaint type codes are there in the database?
SQL: SELECT count(DISTINCT complaint_type_code) FROM complaints
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: Count the number of different complaint type codes.
SQL: SELECT count(DISTINCT complaint_type_code) FROM complaints
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: Find the address line 1 and 2 of the customer with email "vbogisich@example.org".
SQL: SELECT address_line_1 ,  address_line_2 FROM customers WHERE email_address  =  "vbogisich@example.org"
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: What are lines 1 and 2 of the addressed of the customer with the email "vbogisich@example.org"?
SQL: SELECT address_line_1 ,  address_line_2 FROM customers WHERE email_address  =  "vbogisich@example.org"
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: Find the number of complaints with Product Failure type for each complaint status.
SQL: SELECT complaint_status_code ,  count(*) FROM complaints WHERE complaint_type_code  =  "Product Failure" GROUP BY complaint_status_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: Of complaints with the type code "Product Failure", how many had each different status code?
SQL: SELECT complaint_status_code ,  count(*) FROM complaints WHERE complaint_type_code  =  "Product Failure" GROUP BY complaint_status_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: What is first names of the top 5 staff who have handled the greatest number of complaints?
SQL: SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: Return the first names of the 5 staff members who have handled the most complaints.
SQL: SELECT t1.first_name FROM staff AS t1 JOIN complaints AS t2 ON t1.staff_id  =  t2.staff_id GROUP BY t2.staff_id ORDER BY count(*) LIMIT 5
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: Which state has the most customers?
SQL: SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: staff 
columns : [['staff id', 'number'], ['gender', 'text'], ['first name', 'text'], ['last name', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer type code', 'text'], ['address line 1', 'text'], ['address line 2', 'text'], ['town city', 'text'], ['state', 'text'], ['email address', 'text'], ['phone number', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['product category code', 'text'], ['date product first available', 'time'], ['date product discontinued', 'time'], ['product name', 'text'], ['product description', 'text'], ['product price', 'number']]

 -- Table: complaints 
columns : [['complaint id', 'number'], ['product id', 'number'], ['customer id', 'number'], ['complaint outcome code', 'text'], ['complaint status code', 'text'], ['complaint type code', 'text'], ['date complaint raised', 'time'], ['date complaint closed', 'time'], ['staff id', 'number']]

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



Question: Give the state that has the most customers.
SQL: SELECT state FROM customers GROUP BY state ORDER BY count(*) LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: How many submissions are there?
SQL: SELECT count(*) FROM submission
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Count the number of submissions.
SQL: SELECT count(*) FROM submission
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: List the authors of submissions in ascending order of scores.
SQL: SELECT Author FROM submission ORDER BY Scores ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Find the author for each submission and list them in ascending order of submission score.
SQL: SELECT Author FROM submission ORDER BY Scores ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: What are the authors of submissions and their colleges?
SQL: SELECT Author ,  College FROM submission
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: For each submission, show the author and their affiliated college.
SQL: SELECT Author ,  College FROM submission
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show the names of authors from college "Florida" or "Temple"
SQL: SELECT Author FROM submission WHERE College  =  "Florida" OR College  =  "Temple"
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Which authors with submissions are from college "Florida" or "Temple"?
SQL: SELECT Author FROM submission WHERE College  =  "Florida" OR College  =  "Temple"
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: What is the average score of submissions?
SQL: SELECT avg(Scores) FROM submission
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Compute the average score of submissions.
SQL: SELECT avg(Scores) FROM submission
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: What is the author of the submission with the highest score?
SQL: SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Find the author who achieved the highest score in a submission.
SQL: SELECT Author FROM submission ORDER BY Scores DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show different colleges along with the number of authors of submission from each college.
SQL: SELECT College ,  COUNT(*) FROM submission GROUP BY College
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: For each college, return the college name and the count of authors with submissions from that college.
SQL: SELECT College ,  COUNT(*) FROM submission GROUP BY College
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show the most common college of authors of submissions.
SQL: SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Which college has the most authors with submissions?
SQL: SELECT College FROM submission GROUP BY College ORDER BY COUNT(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.
SQL: SELECT College FROM submission WHERE Scores  >  90 INTERSECT SELECT College FROM submission WHERE Scores  <  80
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Which colleges have both authors with submission score above 90 and authors with submission score below 80?
SQL: SELECT College FROM submission WHERE Scores  >  90 INTERSECT SELECT College FROM submission WHERE Scores  <  80
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show the authors of submissions and the acceptance results of their submissions.
SQL: SELECT T2.Author ,  T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: For each submission, find its author and acceptance result.
SQL: SELECT T2.Author ,  T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show the result of the submission with the highest score.
SQL: SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Which submission received the highest score in acceptance result. Show me the result.
SQL: SELECT T1.Result FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID ORDER BY T2.Scores DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show each author and the number of workshops they submitted to.
SQL: SELECT T2.Author ,  COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: How many workshops did each author submit to? Return the author name and the number of workshops.
SQL: SELECT T2.Author ,  COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show the authors who have submissions to more than one workshop.
SQL: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Which authors have submitted to more than one workshop?
SQL: SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID  =  T2.Submission_ID GROUP BY T2.Author HAVING COUNT(DISTINCT T1.workshop_id)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Show the date and venue of each workshop in ascending alphabetical order of the venue.
SQL: SELECT Date ,  Venue FROM workshop ORDER BY Venue
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Sort the each workshop in alphabetical order of the venue. Return the date and venue of each workshop.
SQL: SELECT Date ,  Venue FROM workshop ORDER BY Venue
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: List the authors who do not have submission to any workshop.
SQL: SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)
-- Language PostgreSQL
        -- Tables: 
             -- Table: workshop 
columns : [['workshop id', 'number'], ['date', 'text'], ['venue', 'text'], ['name', 'text']]

 -- Table: submission 
columns : [['submission id', 'number'], ['scores', 'number'], ['author', 'text'], ['college', 'text']]

 -- Table: acceptance 
columns : [['submission id', 'number'], ['workshop id', 'number'], ['result', 'text']]

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



Question: Which authors did not submit to any workshop?
SQL: SELECT Author FROM submission WHERE Submission_ID NOT IN (SELECT Submission_ID FROM acceptance)
-- Language PostgreSQL
        -- Tables: 
             -- Table: investors 
columns : [['investor id', 'number'], ['investor details', 'text']]

 -- Table: lots 
columns : [['lot id', 'number'], ['investor id', 'number'], ['lot details', 'text']]

 -- Table: reference transaction types 
columns : [['transaction type code', 'text'], ['transaction type description', 'text']]

 -- Table: transactions 
columns : [['transaction id', 'number'], ['investor id', 'number'], ['transaction type code', 'text'], ['date of transaction', 'time'], ['amount of transaction', 'number'], ['share count', 'text'], ['other details', 'text']]

 -- Table: sales 
columns : [['sales transaction id', 'number'], ['sales details', 'text']]

 -- Table: purchases 
columns : [['purchase transaction id', 'number'], ['purchase details', 'text']]

 -- Table: transactions lots 
columns : [['transaction id', 'number'], ['lot id', 'number']]

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



Question: Find the number of investors in total.
SQL: SELECT count(*) FROM INVESTORS
-- Language PostgreSQL
        -- Tables: 
             -- Table: investors 
columns : [['investor id', 'number'], ['investor details', 'text']]

 -- Table: lots 
columns : [['lot id', 'number'], ['investor id', 'number'], ['lot details', 'text']]

 -- Table: reference transaction types 
columns : [['transaction type code', 'text'], ['transaction type description', 'text']]

 -- Table: transactions 
columns : [['transaction id', 'number'], ['investor id', 'number'], ['transaction type code', 'text'], ['date of transaction', 'time'], ['amount of transaction', 'number'], ['share count', 'text'], ['other details', 'text']]

 -- Table: sales 
columns : [['sales transaction id', 'number'], ['sales details', 'text']]

 -- Table: purchases 
columns : [['purchase transaction id', 'number'], ['purchase details', 'text']]

 -- Table: transactions lots 
columns : [['transaction id', 'number'], ['lot id', 'number']]

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



Question: Show all investor details.
SQL: SELECT Investor_details FROM INVESTORS
-- Language PostgreSQL
        -- Tables: 
             -- Table: investors 
columns : [['investor id', 'number'], ['investor details', 'text']]

 -- Table: lots 
columns : [['lot id', 'number'], ['investor id', 'number'], ['lot details', 'text']]

 -- Table: reference transaction types 
columns : [['transaction type code', 'text'], ['transaction type description', 'text']]

 -- Table: transactions 
columns : [['transaction id', 'number'], ['investor id', 'number'], ['transaction type code', 'text'], ['date of transaction', 'time'], ['amount of transaction', 'number'], ['share count', 'text'], ['other details', 'text']]

 -- Table: sales 
columns : [['sales transaction id', 'number'], ['sales details', 'text']]

 -- Table: purchases 
columns : [['purchase transaction id', 'number'], ['purchase details', 'text']]

 -- Table: transactions lots 
columns : [['transaction id', 'number'], ['lot id', 'number']]

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



Question: Show all distinct lot details.
SQL: SELECT DISTINCT lot_details FROM LOTS