brief_instruction stringlengths 16 224 | instruction stringlengths 687 8.77k | output stringlengths 18 577 |
|---|---|---|
Show all the Store_Name of drama workshop groups. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show all the Store_Name of drama workshop groups.` to a syntactically-correct PostgreSQL query.
| SELECT Store_Name FROM Drama_Workshop_Groups |
What are the store names of drama workshop groups? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the store names of drama workshop groups?` to a syntactically-correct PostgreSQL query.
| SELECT Store_Name FROM Drama_Workshop_Groups |
Show the minimum, average, maximum order quantity of all invoices. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the minimum, average, maximum order quantity of all invoices.` to a syntactically-correct PostgreSQL query.
| SELECT min(Order_Quantity) , avg(Order_Quantity) , max(Order_Quantity) FROM INVOICES |
What are the minimum, average, and maximum quantities ordered? Check all the invoices. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the minimum, average, and maximum quantities ordered? Check all the invoices.` to a syntactically-correct PostgreSQL query.
| SELECT min(Order_Quantity) , avg(Order_Quantity) , max(Order_Quantity) FROM INVOICES |
What are the distinct payment method codes in all the invoices? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the distinct payment method codes in all the invoices?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT payment_method_code FROM INVOICES |
Show me the distinct payment method codes from the invoice record. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show me the distinct payment method codes from the invoice record.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT payment_method_code FROM INVOICES |
What is the description of the marketing region China? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the description of the marketing region China?` to a syntactically-correct PostgreSQL query.
| SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = "China" |
Find the marketing region description of China? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the marketing region description of China?` to a syntactically-correct PostgreSQL query.
| SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name = "China" |
Show all the distinct product names with price higher than the average. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show all the distinct product names with price higher than the average.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT avg(Product_Price) FROM PRODUCTS) |
What are the distinct names of the products that cost more than the average? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the distinct names of the products that cost more than the average?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price > (SELECT avg(Product_Price) FROM PRODUCTS) |
What is the name of the most expensive product? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the name of the most expensive product?` to a syntactically-correct PostgreSQL query.
| SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1 |
Tell me the name of the most pricy product. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Tell me the name of the most pricy product.` to a syntactically-correct PostgreSQL query.
| SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1 |
List all product names in ascending order of price. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List all product names in ascending order of price.` to a syntactically-correct PostgreSQL query.
| SELECT Product_Name FROM Products ORDER BY Product_Price ASC |
Sort the names of products in ascending order of their price. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Sort the names of products in ascending order of their price.` to a syntactically-correct PostgreSQL query.
| SELECT Product_Name FROM Products ORDER BY Product_Price ASC |
What is the phone number of the performer Ashley? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the phone number of the performer Ashley?` to a syntactically-correct PostgreSQL query.
| SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = "Ashley" |
Find the phone number of performer "Ashley". |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the phone number of performer "Ashley".` to a syntactically-correct PostgreSQL query.
| SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name = "Ashley" |
Show all payment method codes and the number of orders for each code. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show all payment method codes and the number of orders for each code.` to a syntactically-correct PostgreSQL query.
| SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code |
List the distinct payment method codes with the number of orders made |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the distinct payment method codes with the number of orders made` to a syntactically-correct PostgreSQL query.
| SELECT payment_method_code , count(*) FROM INVOICES GROUP BY payment_method_code |
What is the payment method code used by the most orders? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the payment method code used by the most orders?` to a syntactically-correct PostgreSQL query.
| SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1 |
Find the payment method that is used the most often in all the invoices. Give me its code. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the payment method that is used the most often in all the invoices. Give me its code.` to a syntactically-correct PostgreSQL query.
| SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code ORDER BY count(*) DESC LIMIT 1 |
Which city is the address of the store named "FJA Filming" located in? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which city is the address of the store named "FJA Filming" located in?` to a syntactically-correct PostgreSQL query.
| SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = "FJA Filming" |
Find the city the store named "FJA Filming" is in. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the city the store named "FJA Filming" is in.` to a syntactically-correct PostgreSQL query.
| SELECT T1.City_Town FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Store_Name = "FJA Filming" |
What are the states or counties of the address of the stores with marketing region code "CA"? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the states or counties of the address of the stores with marketing region code "CA"?` to a syntactically-correct PostgreSQL query.
| SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = "CA" |
Find the states or counties where the stores with marketing region code "CA" are located. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the states or counties where the stores with marketing region code "CA" are located.` to a syntactically-correct PostgreSQL query.
| SELECT T1.State_County FROM Addresses AS T1 JOIN Stores AS T2 ON T1.Address_ID = T2.Address_ID WHERE T2.Marketing_Region_Code = "CA" |
What is the name of the marketing region that the store Rob Dinning belongs to? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the name of the marketing region that the store Rob Dinning belongs to?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = "Rob Dinning" |
Return the name of the marketing region the store Rob Dinning is located in. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the name of the marketing region the store Rob Dinning is located in.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Marketing_Region_Name FROM Marketing_Regions AS T1 JOIN Stores AS T2 ON T1.Marketing_Region_Code = T2.Marketing_Region_Code WHERE T2.Store_Name = "Rob Dinning" |
What are the descriptions of the service types with product price above 100? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the descriptions of the service types with product price above 100?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 |
Give me the descriptions of the service types that cost more than 100. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give me the descriptions of the service types that cost more than 100.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 |
What is the description, code and the corresponding count of each service type? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the description, code and the corresponding count of each service type?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Service_Type_Description , T2.Service_Type_Code , COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code |
List the description, code and the number of services for each service type. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the description, code and the number of services for each service type.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Service_Type_Description , T2.Service_Type_Code , COUNT(*) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T2.Service_Type_Code |
What is the description and code of the type of service that is performed the most often? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the description and code of the type of service that is performed the most often?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 |
Find the description and code of the service type that is performed the most times. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the description and code of the service type that is performed the most times.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Service_Type_Description , T1.Service_Type_Code FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code GROUP BY T1.Service_Type_Code ORDER BY COUNT(*) DESC LIMIT 1 |
What are the phones and emails of workshop groups in which services are performed? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the phones and emails of workshop groups in which services are performed?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID |
Give me all the phone numbers and email addresses of the workshop groups where services are performed. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give me all the phone numbers and email addresses of the workshop groups where services are performed.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID |
What are the names of workshop groups in which services with product name "film" are performed? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of workshop groups in which services with product name "film" are performed?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = "film" |
Find the names of the workshop groups where services with product name "film" are performed. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the names of the workshop groups where services with product name "film" are performed.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Store_Phone , T1.Store_Email_Address FROM Drama_Workshop_Groups AS T1 JOIN Services AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T2.Product_Name = "film" |
What are the different product names? What is the average product price for each of them? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the different product names? What is the average product price for each of them?` to a syntactically-correct PostgreSQL query.
| SELECT Product_Name , avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name |
For each distinct product name, show its average product price. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `For each distinct product name, show its average product price.` to a syntactically-correct PostgreSQL query.
| SELECT Product_Name , avg(Product_Price) FROM PRODUCTS GROUP BY Product_Name |
What are the product names with average product price smaller than 1000000? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the product names with average product price smaller than 1000000?` to a syntactically-correct PostgreSQL query.
| SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price) < 1000000 |
Find the product names whose average product price is below 1000000. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the product names whose average product price is below 1000000.` to a syntactically-correct PostgreSQL query.
| SELECT Product_Name FROM PRODUCTS GROUP BY Product_Name HAVING avg(Product_Price) < 1000000 |
What are the total order quantities of photo products? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the total order quantities of photo products?` to a syntactically-correct PostgreSQL query.
| SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = "photo" |
Compute the total order quantities of the product "photo". |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Compute the total order quantities of the product "photo".` to a syntactically-correct PostgreSQL query.
| SELECT sum(T1.Order_Quantity) FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_Name = "photo" |
What are the order details of the products with price higher than 2000? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the order details of the products with price higher than 2000?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000 |
Find the order detail for the products with price above 2000. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the order detail for the products with price above 2000.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Other_Item_Details FROM ORDER_ITEMS AS T1 JOIN Products AS T2 ON T1.Product_ID = T2.Product_ID WHERE T2.Product_price > 2000 |
What are the actual delivery dates of orders with quantity 1? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the actual delivery dates of orders with quantity 1?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 |
List the actual delivery date for all the orders with quantity 1 |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the actual delivery date for all the orders with quantity 1` to a syntactically-correct PostgreSQL query.
| SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 |
What are the order dates of orders with price higher than 1000? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the order dates of orders with price higher than 1000?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Order_Date 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 WHERE T3.Product_price > 1000 |
Find the order dates of the orders with price above 1000. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the order dates of the orders with price above 1000.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Order_Date 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 WHERE T3.Product_price > 1000 |
How many distinct currency codes are there for all drama workshop groups? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many distinct currency codes are there for all drama workshop groups?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups |
Find the number of distinct currency codes used in drama workshop groups. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the number of distinct currency codes used in drama workshop groups.` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT Currency_Code) FROM Drama_Workshop_Groups |
What are the names of the drama workshop groups with address in Feliciaberg city? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of the drama workshop groups with address in Feliciaberg city?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg" |
Return the the names of the drama workshop groups that are located in Feliciaberg city. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Return the the names of the drama workshop groups that are located in Feliciaberg city.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Store_Name FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.City_Town = "Feliciaberg" |
What are the email addresses of the drama workshop groups with address in Alaska state? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the email addresses of the drama workshop groups with address in Alaska state?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = "Alaska" |
List the email addresses of the drama workshop groups located in Alaska state. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `List the email addresses of the drama workshop groups located in Alaska state.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Store_Email_Address FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID WHERE T1.State_County = "Alaska" |
Show all cities along with the number of drama workshop groups in each city. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show all cities along with the number of drama workshop groups in each city.` to a syntactically-correct PostgreSQL query.
| SELECT T1.City_Town , count(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town |
How many drama workshop groups are there in each city? Return both the city and the count. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many drama workshop groups are there in each city? Return both the city and the count.` to a syntactically-correct PostgreSQL query.
| SELECT T1.City_Town , count(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town |
What is the marketing region code that has the most drama workshop groups? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the marketing region code that has the most drama workshop groups?` to a syntactically-correct PostgreSQL query.
| SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY count(*) DESC LIMIT 1 |
Which marketing region has the most drama workshop groups? Give me the region code. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which marketing region has the most drama workshop groups? Give me the region code.` to a syntactically-correct PostgreSQL query.
| SELECT Marketing_Region_Code FROM Drama_Workshop_Groups GROUP BY Marketing_Region_Code ORDER BY count(*) DESC LIMIT 1 |
Show all cities where at least one customer lives in but no performer lives in. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show all cities where at least one customer lives in but no performer lives in.` to a syntactically-correct PostgreSQL query.
| SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID |
Which cities have at least one customer but no performer? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which cities have at least one customer but no performer?` to a syntactically-correct PostgreSQL query.
| SELECT T1.City_Town FROM Addresses AS T1 JOIN Customers AS T2 ON T1.Address_ID = T2.Address_ID EXCEPT SELECT T1.City_Town FROM Addresses AS T1 JOIN Performers AS T2 ON T1.Address_ID = T2.Address_ID |
What is the most frequent status of bookings? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the most frequent status of bookings?` to a syntactically-correct PostgreSQL query.
| SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1 |
Which status code is the most common of all the bookings? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which status code is the most common of all the bookings?` to a syntactically-correct PostgreSQL query.
| SELECT Status_Code FROM BOOKINGS GROUP BY Status_Code ORDER BY count(*) DESC LIMIT 1 |
What are the names of the workshop groups that have bookings with status code "stop"? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of the workshop groups that have bookings with status code "stop"?` to a syntactically-correct PostgreSQL query.
| SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" |
Which workshop groups have bookings with status code "stop"? Give me the names. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Which workshop groups have bookings with status code "stop"? Give me the names.` to a syntactically-correct PostgreSQL query.
| SELECT T2.Store_Name FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" |
Show the names of all the clients with no booking. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Show the names of all the clients with no booking.` to a syntactically-correct PostgreSQL query.
| SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID |
What are the names of the clients who do not have any booking? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of the clients who do not have any booking?` to a syntactically-correct PostgreSQL query.
| SELECT Customer_Name FROM Clients EXCEPT SELECT T2.Customer_Name FROM Bookings AS T1 JOIN Clients AS T2 ON T1.Customer_ID = T2.Client_ID |
What is the average quantities ordered with payment method code "MasterCard" on invoices? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the average quantities ordered with payment method code "MasterCard" on invoices?` to a syntactically-correct PostgreSQL query.
| SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = "MasterCard" |
Check the invoices record and compute the average quantities ordered with the payment method "MasterCard". |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Check the invoices record and compute the average quantities ordered with the payment method "MasterCard".` to a syntactically-correct PostgreSQL query.
| SELECT avg(Order_Quantity) FROM Invoices WHERE payment_method_code = "MasterCard" |
What is the product ID of the most frequently ordered item on invoices? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the product ID of the most frequently ordered item on invoices?` to a syntactically-correct PostgreSQL query.
| SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1 |
Find the id of the product ordered the most often on invoices. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the id of the product ordered the most often on invoices.` to a syntactically-correct PostgreSQL query.
| SELECT Product_ID FROM INVOICES GROUP BY Product_ID ORDER BY COUNT(*) DESC LIMIT 1 |
What is the description of the service type which offers both the photo product and the film product? |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the description of the service type which offers both the photo product and the film product?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film' |
Give me the description of the service type that offers not only the photo product but also the film product. |
-- Language PostgreSQL
-- Tables:
-- Table: reference payment methods
columns : [['payment method code', 'text'], ['payment method description', 'text']]
-- Table: reference service types
columns : [['service type code', 'text'], ['parent service type code', 'text'], ['service type description', 'text']]
-- Table: addresses
columns : [['address id', 'text'], ['line 1', 'text'], ['line 2', 'text'], ['city town', 'text'], ['state county', 'text'], ['other details', 'text']]
-- Table: products
columns : [['product id', 'text'], ['product name', 'text'], ['product price', 'number'], ['product description', 'text'], ['other product service details', 'text']]
-- Table: marketing regions
columns : [['marketing region code', 'text'], ['marketing region name', 'text'], ['marketing region descriptrion', 'text'], ['other details', 'text']]
-- Table: clients
columns : [['client id', 'number'], ['address id', 'number'], ['customer email address', 'text'], ['customer name', 'text'], ['customer phone', 'text'], ['other details', 'text']]
-- Table: drama workshop groups
columns : [['workshop group id', 'number'], ['address id', 'number'], ['currency code', 'text'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: performers
columns : [['performer id', 'number'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: customers
columns : [['customer id', 'text'], ['address id', 'number'], ['customer name', 'text'], ['customer phone', 'text'], ['customer email address', 'text'], ['other details', 'text']]
-- Table: stores
columns : [['store id', 'text'], ['address id', 'number'], ['marketing region code', 'text'], ['store name', 'text'], ['store phone', 'text'], ['store email address', 'text'], ['other details', 'text']]
-- Table: bookings
columns : [['booking id', 'number'], ['customer id', 'number'], ['workshop group id', 'text'], ['status code', 'text'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: performers in bookings
columns : [['order id', 'number'], ['performer id', 'number']]
-- Table: customer orders
columns : [['order id', 'number'], ['customer id', 'number'], ['store id', 'number'], ['order date', 'time'], ['planned delivery date', 'time'], ['actual delivery date', 'time'], ['other order details', 'text']]
-- Table: order items
columns : [['order item id', 'number'], ['order id', 'number'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text']]
-- Table: invoices
columns : [['invoice id', 'number'], ['order id', 'number'], ['payment method code', 'text'], ['product id', 'number'], ['order quantity', 'text'], ['other item details', 'text'], ['order item id', 'number']]
-- Table: services
columns : [['service id', 'number'], ['service type code', 'text'], ['workshop group id', 'number'], ['product description', 'text'], ['product name', 'text'], ['product price', 'number'], ['other product service details', 'text']]
-- Table: bookings services
columns : [['order id', 'number'], ['product id', 'number']]
-- Table: invoice items
columns : [['invoice item id', 'number'], ['invoice id', 'number'], ['order id', 'number'], ['order item id', 'number'], ['product id', 'number'], ['order quantity', 'number'], ['other item details', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Give me the description of the service type that offers not only the photo product but also the film product.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'photo' INTERSECT SELECT T1.Service_Type_Description FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Name = 'film' |
How many bands are there? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many bands are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Band |
Find the number of bands. |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the number of bands.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Band |
What are all the labels? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are all the labels?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT label FROM Albums |
What are the different album labels listed? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the different album labels listed?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT label FROM Albums |
Find all the albums in 2012. |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find all the albums in 2012.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM Albums WHERE YEAR = 2012 |
return all columns of the albums created in the year of 2012. |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `return all columns of the albums created in the year of 2012.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM Albums WHERE YEAR = 2012 |
Find all the stage positions of the musicians with first name "Solveig" |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find all the stage positions of the musicians with first name "Solveig"` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = "Solveig" |
What are the different stage positions for all musicians whose first name is "Solveig"? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the different stage positions for all musicians whose first name is "Solveig"?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T1.stageposition FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE Firstname = "Solveig" |
How many songs are there? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many songs are there?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Songs |
Count the number of songs. |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Count the number of songs.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM Songs |
Find all the songs performed by artist with last name "Heilo" |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find all the songs performed by artist with last name "Heilo"` to a syntactically-correct PostgreSQL query.
| SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo" |
What are the names of the songs by the artist whose last name is "Heilo"? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of the songs by the artist whose last name is "Heilo"?` to a syntactically-correct PostgreSQL query.
| SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.Lastname = "Heilo" |
Hom many musicians performed in the song "Flash"? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Hom many musicians performed in the song "Flash"?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = "Flash" |
How many musicians play in the song "Flash"? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many musicians play in the song "Flash"?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.Title = "Flash" |
Find all the songs produced by artists with first name "Marianne". |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find all the songs produced by artists with first name "Marianne".` to a syntactically-correct PostgreSQL query.
| SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne" |
What are the names of all songs produced by the artist with the first name "Marianne"? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of all songs produced by the artist with the first name "Marianne"?` to a syntactically-correct PostgreSQL query.
| SELECT T3.Title FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T2.firstname = "Marianne" |
Who performed the song named "Badlands"? Show the first name and the last name. |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Who performed the song named "Badlands"? Show the first name and the last name.` to a syntactically-correct PostgreSQL query.
| SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" |
What are the first and last names of the artist who perfomed the song "Badlands"? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the first and last names of the artist who perfomed the song "Badlands"?` to a syntactically-correct PostgreSQL query.
| SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" |
Who is performing in the back stage position for the song "Badlands"? Show the first name and the last name. |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Who is performing in the back stage position for the song "Badlands"? Show the first name and the last name.` to a syntactically-correct PostgreSQL query.
| SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back" |
What are the first and last names of the performer who was in the back stage position for the song "Badlands"? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the first and last names of the performer who was in the back stage position for the song "Badlands"?` to a syntactically-correct PostgreSQL query.
| SELECT T2.firstname , T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId WHERE T3.Title = "Badlands" AND T1.StagePosition = "back" |
How many unique labels are there for albums? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many unique labels are there for albums?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT label) FROM albums |
What are the unique labels for the albums? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the unique labels for the albums?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT label) FROM albums |
What is the label that has the most albums? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the label that has the most albums?` to a syntactically-correct PostgreSQL query.
| SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1 |
What is the label with the most albums? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the label with the most albums?` to a syntactically-correct PostgreSQL query.
| SELECT label FROM albums GROUP BY label ORDER BY count(*) DESC LIMIT 1 |
What is the last name of the musician that have produced the most number of songs? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the last name of the musician that have produced the most number of songs?` to a syntactically-correct PostgreSQL query.
| SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1 |
What is the last name of the musician who was in the most songs? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the last name of the musician who was in the most songs?` to a syntactically-correct PostgreSQL query.
| SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.SongId = T1.SongId GROUP BY lastname ORDER BY count(*) DESC LIMIT 1 |
What is the last name of the musician that has been at the back position the most? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the last name of the musician that has been at the back position the most?` to a syntactically-correct PostgreSQL query.
| SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = "back" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1 |
What is the last name of the musicians who has played back position the most? |
-- Language PostgreSQL
-- Tables:
-- Table: songs
columns : [['song id', 'number'], ['title', 'text']]
-- Table: albums
columns : [['aid', 'number'], ['title', 'text'], ['year', 'number'], ['label', 'text'], ['type', 'text']]
-- Table: band
columns : [['id', 'number'], ['first name', 'text'], ['last name', 'text']]
-- Table: instruments
columns : [['song id', 'number'], ['bandmate id', 'number'], ['instrument', 'text']]
-- Table: performance
columns : [['song id', 'number'], ['bandmate', 'number'], ['stage position', 'text']]
-- Table: track lists
columns : [['album id', 'number'], ['position', 'number'], ['song id', 'number']]
-- Table: vocals
columns : [['song id', 'number'], ['bandmate', 'number'], ['type', 'text']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the last name of the musicians who has played back position the most?` to a syntactically-correct PostgreSQL query.
| SELECT T2.lastname FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id WHERE stageposition = "back" GROUP BY lastname ORDER BY count(*) DESC LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.