sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 order id, customer id for orders in Cancelled status, ordered by their order dates.
SQL: SELECT order_id ,  customer_id FROM customer_orders WHERE order_status_code  =   "Cancelled" ORDER BY order_date
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 order ids and customer ids for orders that have been Cancelled, sorted by their order dates?
SQL: SELECT order_id ,  customer_id FROM customer_orders WHERE order_status_code  =   "Cancelled" ORDER BY order_date
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 names of products that were bought by at least two distinct customers.
SQL: SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id  =  T2.order_id JOIN products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 distinct names of products purchased by at least two different customers?
SQL: SELECT DISTINCT T3.product_name FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id  =  T2.order_id JOIN products AS T3 ON T2.product_id  =  T3.product_id GROUP BY T3.product_id HAVING COUNT (DISTINCT T1.customer_id)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 names of customers who have bought by at least three distinct products.
SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id)  >=  3
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 distinct names of customers who have purchased at least three different products?
SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id JOIN order_items AS T3 ON T2.order_id  =  T3.order_id GROUP BY T1.customer_id HAVING COUNT (DISTINCT T3.product_id)  >=  3
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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



Question: Find the name and gender of the staff who has been assigned the job of Sales Person but never Clerical Staff.
SQL: SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Sales Person" EXCEPT SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Clerical Staff"
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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



Question: What are the names and genders of staff who have held the title Sales Person, but never Clerical Staff?
SQL: SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Sales Person" EXCEPT SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Clerical Staff"
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 id and name of customers whose address contains WY state and do not use credit card for payment.
SQL: SELECT customer_id ,  customer_name FROM customers WHERE customer_address LIKE "%WY%" AND payment_method_code != "Credit Card"
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 customers with addressed that contain WY and who do not use a credit card for payment?
SQL: SELECT customer_id ,  customer_name FROM customers WHERE customer_address LIKE "%WY%" AND payment_method_code != "Credit Card"
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 average price of all product clothes.
SQL: SELECT avg(product_price) FROM products WHERE product_type_code  =  'Clothes'
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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 price of clothes?
SQL: SELECT avg(product_price) FROM products WHERE product_type_code  =  'Clothes'
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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



Question: Find the name of the most expensive hardware product.
SQL: SELECT product_name FROM products WHERE product_type_code  =  'Hardware' ORDER BY product_price DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['address details', 'text']]

 -- Table: staff 
columns : [['staff id', 'number'], ['staff gender', 'text'], ['staff name', 'text']]

 -- Table: suppliers 
columns : [['supplier id', 'number'], ['supplier name', 'text'], ['supplier phone', 'text']]

 -- Table: department store chain 
columns : [['department store chain id', 'number'], ['department store chain name', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['payment method code', 'text'], ['customer code', 'text'], ['customer name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text']]

 -- Table: products 
columns : [['product id', 'number'], ['product type code', 'text'], ['product name', 'text'], ['product price', 'number']]

 -- Table: supplier addresses 
columns : [['supplier id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

 -- Table: customer addresses 
columns : [['customer id', 'number'], ['address id', 'number'], ['date from', 'time'], ['date to', 'time']]

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

 -- Table: department stores 
columns : [['department store id', 'number'], ['department store chain id', 'number'], ['store name', 'text'], ['store address', 'text'], ['store phone', 'text'], ['store email', 'text']]

 -- Table: departments 
columns : [['department id', 'number'], ['department store id', 'number'], ['department name', 'text']]

 -- Table: order items 
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number']]

 -- Table: product suppliers 
columns : [['product id', 'number'], ['supplier id', 'number'], ['date supplied from', 'time'], ['date supplied to', 'time'], ['total amount purchased', 'text'], ['total value purchased', 'number']]

 -- Table: staff department assignments 
columns : [['staff id', 'number'], ['department id', 'number'], ['date assigned from', 'time'], ['job title code', 'text'], ['date assigned to', 'time']]

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



Question: What is the name of the hardware product with the greatest price?
SQL: SELECT product_name FROM products WHERE product_type_code  =  'Hardware' ORDER BY product_price DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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 aircrafts are there?
SQL: SELECT count(*) FROM aircraft
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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 the number of aircraft?
SQL: SELECT count(*) FROM aircraft
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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: List the description of all aircrafts.
SQL: SELECT Description FROM aircraft
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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 the descriptions for the aircrafts?
SQL: SELECT Description FROM aircraft
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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 the average number of international passengers of all airports?
SQL: SELECT avg(International_Passengers) FROM airport
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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 the average number of international passengers for an airport?
SQL: SELECT avg(International_Passengers) FROM airport
-- Language PostgreSQL
        -- Tables: 
             -- Table: pilot 
columns : [['pilot id', 'number'], ['name', 'text'], ['age', 'number']]

 -- Table: aircraft 
columns : [['aircraft id', 'number'], ['aircraft', 'text'], ['description', 'text'], ['max gross weight', 'text'], ['total disk area', 'text'], ['max disk loading', 'text']]

 -- Table: match 
columns : [['round', 'number'], ['location', 'text'], ['country', 'text'], ['date', 'text'], ['fastest qualifying', 'text'], ['winning pilot', 'text'], ['winning aircraft', 'text']]

 -- Table: airport 
columns : [['airport id', 'number'], ['airport name', 'text'], ['total passengers', 'number'], ['% change 2007', 'text'], ['international passengers', 'number'], ['domestic passengers', 'number'], ['transit passengers', 'number'], ['aircraft movements', 'number'], ['freight metric tonnes', 'number']]

 -- Table: airport aircraft 
columns : [['id', 'number'], ['airport id', 'number'], ['aircraft 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 the number of international and domestic passengers of the airport named London "Heathrow"?
SQL: SELECT International_Passengers ,  Domestic_Passengers FROM airport WHERE Airport_Name  =  "London Heathrow"