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

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find the order id and customer id associated with the oldest order.
SQL: SELECT order_id ,  customer_id FROM orders ORDER BY date_order_placed LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find the id of the order whose shipment tracking number is "3452".
SQL: SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Which order's shipment tracking number is "3452"? Give me the id of the order.
SQL: SELECT order_id FROM shipments WHERE shipment_tracking_number = "3452"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find the ids of all the order items whose product id is 11.
SQL: SELECT order_item_id FROM order_items WHERE product_id = 11
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find all the order items whose product id is 11. What are the order item ids?
SQL: SELECT order_item_id FROM order_items WHERE product_id = 11
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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 name of all the distinct customers who have orders with status "Packing".
SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Which customers have orders with status "Packing"? Give me the customer names.
SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find the details of all the distinct customers who have orders with status "On Road".
SQL: SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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 distinct customers who have orders with status "On Road"? Give me the customer details?
SQL: SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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 name of the customer who has the most orders?
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Which customer made the most orders? Find the customer name.
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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 customer id of the customer who has the most orders?
SQL: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find the id of the customer who made the most orders.
SQL: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Give me a list of id and status of orders which belong to the customer named "Jeramie".
SQL: SELECT T2.order_id ,  T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Which orders are made by the customer named "Jeramie"? Give me the order ids and status.
SQL: SELECT T2.order_id ,  T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find the dates of orders which belong to the customer named "Jeramie".
SQL: SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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 dates of the orders made by the customer named "Jeramie"?
SQL: SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= "2009-01-01" AND T2.date_order_placed <= "2010-01-01"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Which customers made orders between 2009-01-01 and 2010-01-01? Find their names.
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= "2009-01-01" AND T2.date_order_placed <= "2010-01-01"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01?
SQL: SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= "1975-01-01" AND T1.date_order_placed <= "1976-01-01"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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 distinct ids of products ordered between 1975-01-01 and 1976-01-01??
SQL: SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= "1975-01-01" AND T1.date_order_placed <= "1976-01-01"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find the names of the customers who have order status both "On Road" and "Shipped".
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Which customers have both "On Road" and "Shipped" as order status? List the customer names.
SQL: SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Find the id of the customers who have order status both "On Road" and "Shipped".
SQL: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

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

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



Question: Which customers have both "On Road" and "Shipped" as order status? List the customer ids.
SQL: SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped"
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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: When was the order placed whose shipment tracking number is 3452? Give me the date.
SQL: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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: On which day was the order placed whose shipment tracking number is 3452?
SQL: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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 placement date of the order whose invoice number is 10?
SQL: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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: On what day was the order with invoice number 10 placed?
SQL: SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
-- Language PostgreSQL
        -- Tables: 
             -- Table: customers 
columns : [['customer id', 'number'], ['customer name', 'text'], ['customer details', 'text']]

 -- Table: invoices 
columns : [['invoice number', 'number'], ['invoice date', 'time'], ['invoice details', 'text']]

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

 -- Table: products 
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]

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

 -- Table: shipments 
columns : [['shipment id', 'number'], ['order id', 'number'], ['invoice number', 'number'], ['shipment tracking number', 'text'], ['shipment date', 'time'], ['other shipment details', 'text']]

 -- Table: shipment items 
columns : [['shipment id', 'number'], ['order item 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 count and id of each product in all the orders.
SQL: SELECT count(*) ,  T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id