sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 ids for all transactions whose amounts are greater than the average.
SQL: SELECT transaction_id FROM Financial_transactions WHERE transaction_amount  >  (SELECT avg(transaction_amount) FROM Financial_transactions)
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the ids for transactions that have an amount greater than the average amount of a transaction?
SQL: SELECT transaction_id FROM Financial_transactions WHERE transaction_amount  >  (SELECT avg(transaction_amount) FROM Financial_transactions)
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the transaction types and the total amount of transactions.
SQL: SELECT transaction_type ,  sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 total transaction amounts for each transaction type?
SQL: SELECT transaction_type ,  sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the account name, id and the number of transactions for each account.
SQL: SELECT T2.account_name ,  T1.account_id ,  count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 names and ids of each account, as well as the number of transactions.
SQL: SELECT T2.account_name ,  T1.account_id ,  count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the account id with most number of transactions.
SQL: SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the id of the account with the most transactions?
SQL: SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the account id and name with at least 4 transactions.
SQL: SELECT T1.account_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id HAVING count(*)  >=  4
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the ids and names of accounts with 4 or more transactions?
SQL: SELECT T1.account_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id HAVING count(*)  >=  4
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 product sizes.
SQL: SELECT DISTINCT product_size FROM Products
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the different product sizes?
SQL: SELECT DISTINCT product_size FROM Products
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 product colors.
SQL: SELECT DISTINCT product_color FROM Products
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the different product colors?
SQL: SELECT DISTINCT product_color FROM Products
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the invoice number and the number of transactions for each invoice.
SQL: SELECT invoice_number ,  count(*) FROM Financial_transactions GROUP BY invoice_number
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 transactions correspond to each invoice number?
SQL: SELECT invoice_number ,  count(*) FROM Financial_transactions GROUP BY invoice_number
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the invoice number and invoice date for the invoice with most number of transactions?
SQL: SELECT T2.invoice_number ,  T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number  =  T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 the invoice number and invoice date corresponding to the invoice with the greatest number of transactions?
SQL: SELECT T2.invoice_number ,  T2.invoice_date FROM Financial_transactions AS T1 JOIN Invoices AS T2 ON T1.invoice_number  =  T2.invoice_number GROUP BY T1.invoice_number ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer middle initial', 'text'], ['customer last name', 'text'], ['gender', 'text'], ['email address', 'text'], ['login name', 'text'], ['login password', 'text'], ['phone number', 'text'], ['town city', 'text'], ['state county province', 'text'], ['country', 'text']]

 -- Table: orders 
columns : [['order id', 'number'], ['customer id', 'number'], ['date order placed', 'time'], ['order details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['order id', 'number'], ['invoice date', 'time']]

 -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['date account opened', 'time'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: product categories 
columns : [['production type code', 'text'], ['product type description', 'text'], ['vat rating', 'number']]

 -- Table: products 
columns : [['product id', 'number'], ['parent product id', 'number'], ['production type code', 'text'], ['unit price', 'number'], ['product name', 'text'], ['product color', 'text'], ['product size', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['account id', 'number'], ['invoice number', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['product quantity', 'text'], ['other order item details', 'text']]

 -- Table: invoice line items 
columns : [['order item id', 'number'], ['invoice number', 'number'], ['product id', 'number'], ['product title', 'text'], ['product quantity', 'text'], ['product price', 'number'], ['derived product cost', 'number'], ['derived vat payable', 'number'], ['derived total cost', '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 invoices do we have?
SQL: SELECT count(*) FROM Invoices