brief_instruction stringlengths 16 224 | instruction stringlengths 687 8.77k | output stringlengths 18 577 |
|---|---|---|
Find the name of companies whose revenue is greater than the average revenue of all companies. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the name of companies whose revenue is greater than the average revenue of all companies.` to a syntactically-correct PostgreSQL query.
| SELECT name FROM manufacturers WHERE revenue > (SELECT avg(revenue) FROM manufacturers) |
What are the names of manufacturers with revenue greater than the average of all revenues? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of manufacturers with revenue greater than the average of all revenues?` to a syntactically-correct PostgreSQL query.
| SELECT name FROM manufacturers WHERE revenue > (SELECT avg(revenue) FROM manufacturers) |
Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the name of companies whose revenue is smaller than the revenue of all companies based in Austin.` to a syntactically-correct PostgreSQL query.
| SELECT name FROM manufacturers WHERE revenue < (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin') |
What are the names of companies with revenue less than the lowest revenue of any manufacturer in Austin? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of companies with revenue less than the lowest revenue of any manufacturer in Austin?` to a syntactically-correct PostgreSQL query.
| SELECT name FROM manufacturers WHERE revenue < (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin') |
Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the total revenue of companies whose revenue is larger than the revenue of some companies based in Austin.` to a syntactically-correct PostgreSQL query.
| SELECT sum(revenue) FROM manufacturers WHERE revenue > (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin') |
What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the total revenue of companies with revenue greater than the lowest revenue of any manufacturer in Austin?` to a syntactically-correct PostgreSQL query.
| SELECT sum(revenue) FROM manufacturers WHERE revenue > (SELECT min(revenue) FROM manufacturers WHERE headquarter = 'Austin') |
Find the total revenue of companies of each founder. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the total revenue of companies of each founder.` to a syntactically-correct PostgreSQL query.
| SELECT sum(revenue) , founder FROM manufacturers GROUP BY founder |
What is the total revenue of companies started by founder? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the total revenue of companies started by founder?` to a syntactically-correct PostgreSQL query.
| SELECT sum(revenue) , founder FROM manufacturers GROUP BY founder |
Find the name and revenue of the company that earns the highest revenue in each city. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the name and revenue of the company that earns the highest revenue in each city.` to a syntactically-correct PostgreSQL query.
| SELECT name , max(revenue) , Headquarter FROM manufacturers GROUP BY Headquarter |
What are the names and revenues of the companies with the highest revenues in each headquarter city? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names and revenues of the companies with the highest revenues in each headquarter city?` to a syntactically-correct PostgreSQL query.
| SELECT name , max(revenue) , Headquarter FROM manufacturers GROUP BY Headquarter |
Find the total revenue for each manufacturer. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the total revenue for each manufacturer.` to a syntactically-correct PostgreSQL query.
| SELECT sum(revenue) , name FROM manufacturers GROUP BY name |
What is the total revenue of each manufacturer? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the total revenue of each manufacturer?` to a syntactically-correct PostgreSQL query.
| SELECT sum(revenue) , name FROM manufacturers GROUP BY name |
Find the average prices of all products from each manufacture, and list each company's name. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the average prices of all products from each manufacture, and list each company's name.` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.price) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name |
What are the average prices of products for each manufacturer? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the average prices of products for each manufacturer?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.price) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name |
Find the number of different products that are produced by companies at different headquarter cities. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the number of different products that are produced by companies at different headquarter cities.` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT T1.name) , T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter |
How many different products are produced in each headquarter city? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many different products are produced in each headquarter city?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT T1.name) , T2.Headquarter FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.Headquarter |
Find number of products which Sony does not make. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find number of products which Sony does not make.` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony') |
How many products are not made by Sony? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many products are not made by Sony?` to a syntactically-correct PostgreSQL query.
| SELECT count(DISTINCT name) FROM products WHERE name NOT IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony') |
Find the name of companies that do not make DVD drive. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the name of companies that do not make DVD drive.` to a syntactically-correct PostgreSQL query.
| SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive' |
What are the names of companies that do not make DVD drives? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of companies that do not make DVD drives?` to a syntactically-correct PostgreSQL query.
| SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive' |
Find the number of products for each manufacturer, showing the name of each company. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find the number of products for each manufacturer, showing the name of each company.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name |
How many products are there for each manufacturer? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many products are there for each manufacturer?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name |
Select the names of all the products in the store. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the names of all the products in the store.` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM Products |
What are the names of all products? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of all products?` to a syntactically-correct PostgreSQL query.
| SELECT Name FROM Products |
Select the names and the prices of all the products in the store. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the names and the prices of all the products in the store.` to a syntactically-correct PostgreSQL query.
| SELECT name , price FROM products |
What are the names and prices of all products in the store? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names and prices of all products in the store?` to a syntactically-correct PostgreSQL query.
| SELECT name , price FROM products |
Select the name of the products with a price less than or equal to $200. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the name of the products with a price less than or equal to $200.` to a syntactically-correct PostgreSQL query.
| SELECT name FROM products WHERE price <= 200 |
What are the names of products with price at most 200? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names of products with price at most 200?` to a syntactically-correct PostgreSQL query.
| SELECT name FROM products WHERE price <= 200 |
Find all information of all the products with a price between $60 and $120. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Find all information of all the products with a price between $60 and $120.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM products WHERE price BETWEEN 60 AND 120 |
What is all the information of all the products that have a price between 60 and 120? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the information of all the products that have a price between 60 and 120?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM products WHERE price BETWEEN 60 AND 120 |
Compute the average price of all the products. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Compute the average price of all the products.` to a syntactically-correct PostgreSQL query.
| SELECT avg(price) FROM products |
What is the average price across all products? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the average price across all products?` to a syntactically-correct PostgreSQL query.
| SELECT avg(price) FROM products |
Compute the average price of all products with manufacturer code equal to 2. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Compute the average price of all products with manufacturer code equal to 2.` to a syntactically-correct PostgreSQL query.
| SELECT avg(price) FROM products WHERE Manufacturer = 2 |
What is the average price of products with manufacturer codes equal to 2? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the average price of products with manufacturer codes equal to 2?` to a syntactically-correct PostgreSQL query.
| SELECT avg(price) FROM products WHERE Manufacturer = 2 |
Compute the number of products with a price larger than or equal to $180. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Compute the number of products with a price larger than or equal to $180.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM products WHERE price >= 180 |
How many products have prices of at least 180? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `How many products have prices of at least 180?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM products WHERE price >= 180 |
Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order). |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).` to a syntactically-correct PostgreSQL query.
| SELECT name , price FROM products WHERE price >= 180 ORDER BY price DESC , name ASC |
What are the names and prices of products that cost at least 180, sorted by price decreasing and name ascending? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names and prices of products that cost at least 180, sorted by price decreasing and name ascending?` to a syntactically-correct PostgreSQL query.
| SELECT name , price FROM products WHERE price >= 180 ORDER BY price DESC , name ASC |
Select all the data from the products and each product's manufacturer. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select all the data from the products and each product's manufacturer.` to a syntactically-correct PostgreSQL query.
| SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code |
What is all the product data, as well as each product's manufacturer? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is all the product data, as well as each product's manufacturer?` to a syntactically-correct PostgreSQL query.
| SELECT * FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code |
Select the average price of each manufacturer's products, showing only the manufacturer's code. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the average price of each manufacturer's products, showing only the manufacturer's code.` to a syntactically-correct PostgreSQL query.
| SELECT AVG(Price) , Manufacturer FROM Products GROUP BY Manufacturer |
What are the average prices of products, grouped by manufacturer code? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the average prices of products, grouped by manufacturer code?` to a syntactically-correct PostgreSQL query.
| SELECT AVG(Price) , Manufacturer FROM Products GROUP BY Manufacturer |
Select the average price of each manufacturer's products, showing the manufacturer's name. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the average price of each manufacturer's products, showing the manufacturer's name.` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name |
What are the average prices of products, grouped by manufacturer name? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the average prices of products, grouped by manufacturer name?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name |
Select the names of manufacturer whose products have an average price higher than or equal to $150. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the names of manufacturer whose products have an average price higher than or equal to $150.` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150 |
What are the names and average prices of products for manufacturers whose products cost on average 150 or more? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the names and average prices of products for manufacturers whose products cost on average 150 or more?` to a syntactically-correct PostgreSQL query.
| SELECT avg(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING avg(T1.price) >= 150 |
Select the name and price of the cheapest product. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the name and price of the cheapest product.` to a syntactically-correct PostgreSQL query.
| SELECT name , price FROM Products ORDER BY price ASC LIMIT 1 |
What is the name and price of the cheapest product? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What is the name and price of the cheapest product?` to a syntactically-correct PostgreSQL query.
| SELECT name , price FROM Products ORDER BY price ASC LIMIT 1 |
Select the name of each manufacturer along with the name and price of its most expensive product. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the name of each manufacturer along with the name and price of its most expensive product.` to a syntactically-correct PostgreSQL query.
| SELECT T1.Name , max(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name |
For each manufacturer name, what are the names and prices of their most expensive product? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `For each manufacturer name, what are the names and prices of their most expensive product?` to a syntactically-correct PostgreSQL query.
| SELECT T1.Name , max(T1.Price) , T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name |
Select the code of the product that is cheapest in each product category. |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `Select the code of the product that is cheapest in each product category.` to a syntactically-correct PostgreSQL query.
| SELECT code , name , min(price) FROM products GROUP BY name |
What are the codes and names of the cheapest products in each category? |
-- Language PostgreSQL
-- Tables:
-- Table: manufacturers
columns : [['code', 'number'], ['name', 'text'], ['headquarter', 'text'], ['founder', 'text'], ['revenue', 'number']]
-- Table: products
columns : [['code', 'number'], ['name', 'text'], ['price', 'number'], ['manufacturer', 'number']]
You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL.
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.
Translate `What are the codes and names of the cheapest products in each category?` to a syntactically-correct PostgreSQL query.
| SELECT code , name , min(price) FROM products GROUP BY name |
What is the id of the problem log that is created most recently? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 id of the problem log that is created most recently?` to a syntactically-correct PostgreSQL query.
| SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1 |
Which problem log was created most recently? Give me the log id. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problem log was created most recently? Give me the log id.` to a syntactically-correct PostgreSQL query.
| SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1 |
What is the oldest log id and its corresponding problem id? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 oldest log id and its corresponding problem id?` to a syntactically-correct PostgreSQL query.
| SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1 |
Find the oldest log id and its corresponding problem id. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 oldest log id and its corresponding problem id.` to a syntactically-correct PostgreSQL query.
| SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1 |
Find all the ids and dates of the logs for the problem whose id is 10. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 all the ids and dates of the logs for the problem whose id is 10.` to a syntactically-correct PostgreSQL query.
| SELECT problem_log_id , log_entry_date FROM problem_log WHERE problem_id = 10 |
For the problem with id 10, return the ids and dates of its problem logs. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 the problem with id 10, return the ids and dates of its problem logs.` to a syntactically-correct PostgreSQL query.
| SELECT problem_log_id , log_entry_date FROM problem_log WHERE problem_id = 10 |
List all the log ids and their descriptions from the problem logs. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 the log ids and their descriptions from the problem logs.` to a syntactically-correct PostgreSQL query.
| SELECT problem_log_id , log_entry_description FROM problem_log |
What are the log id and entry description of each problem? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 log id and entry description of each problem?` to a syntactically-correct PostgreSQL query.
| SELECT problem_log_id , log_entry_description FROM problem_log |
List the first and last names of all distinct staff members who are assigned to the problem whose id is 1. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 first and last names of all distinct staff members who are assigned to the problem whose id is 1.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1 |
Which staff members are assigned to the problem with id 1? Give me their first and last names. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 staff members are assigned to the problem with id 1? Give me their first and last names.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1 |
List the problem id and log id which are assigned to the staff named Rylan Homenick. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problem id and log id which are assigned to the staff named Rylan Homenick.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick" |
Which problem id and log id are assigned to the staff named Rylan Homenick? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problem id and log id are assigned to the staff named Rylan Homenick?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick" |
How many problems are there for product voluptatem? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problems are there for product voluptatem?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem" |
How many problems did the product called "voluptatem" have in record? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problems did the product called "voluptatem" have in record?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem" |
How many problems does the product with the most problems have? List the number of the problems and product name. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problems does the product with the most problems have? List the number of the problems and product name.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1 |
Which product has the most problems? Give me the number of problems and the product name. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 product has the most problems? Give me the number of problems and the product name.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1 |
Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 a list of descriptions of the problems that are reported by the staff whose first name is Christop.` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" |
Which problems are reported by the staff with first name "Christop"? Show the descriptions of the problems. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problems are reported by the staff with first name "Christop"? Show the descriptions of the problems.` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" |
Find the ids of the problems that are reported by the staff whose last name is Bosco. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems that are reported by the staff whose last name is Bosco.` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco" |
Which problems are reported by the staff with last name "Bosco"? Show the ids of the problems. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problems are reported by the staff with last name "Bosco"? Show the ids of the problems.` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco" |
What are the ids of the problems which are reported after 1978-06-26? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems which are reported after 1978-06-26?` to a syntactically-correct PostgreSQL query.
| SELECT problem_id FROM problems WHERE date_problem_reported > "1978-06-26" |
Find the ids of the problems reported after 1978-06-26. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems reported after 1978-06-26.` to a syntactically-correct PostgreSQL query.
| SELECT problem_id FROM problems WHERE date_problem_reported > "1978-06-26" |
What are the ids of the problems which are reported before 1978-06-26? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems which are reported before 1978-06-26?` to a syntactically-correct PostgreSQL query.
| SELECT problem_id FROM problems WHERE date_problem_reported < "1978-06-26" |
Which problems are reported before 1978-06-26? Give me the ids of the problems. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problems are reported before 1978-06-26? Give me the ids of the problems.` to a syntactically-correct PostgreSQL query.
| SELECT problem_id FROM problems WHERE date_problem_reported < "1978-06-26" |
For each product which has problems, what are the number of problems and the product id? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 product which has problems, what are the number of problems and the product id?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id |
For each product with some problems, list the count of problems and the product id. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 product with some problems, list the count of problems and the product id.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id |
For each product that has problems, find the number of problems reported after 1986-11-13 and the product id? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 product that has problems, find the number of problems reported after 1986-11-13 and the product id?` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id |
What are the products that have problems reported after 1986-11-13? Give me the product id and the count of problems reported after 1986-11-13. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 products that have problems reported after 1986-11-13? Give me the product id and the count of problems reported after 1986-11-13.` to a syntactically-correct PostgreSQL query.
| SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id |
List the names of all the distinct product names in alphabetical order? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 names of all the distinct product names in alphabetical order?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT product_name FROM product ORDER BY product_name |
Sort all the distinct product names in alphabetical order. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 all the distinct product names in alphabetical order.` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT product_name FROM product ORDER BY product_name |
List all the distinct product names ordered by product id? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 the distinct product names ordered by product id?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT product_name FROM product ORDER BY product_id |
What is the list of distinct product names sorted by product id? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 list of distinct product names sorted by product id?` to a syntactically-correct PostgreSQL query.
| SELECT DISTINCT product_name FROM product ORDER BY product_id |
What are the id of problems reported by the staff named Dameon Frami or Jolie Weber? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 id of problems reported by the staff named Dameon Frami or Jolie Weber?` to a syntactically-correct PostgreSQL query.
| SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Jolie" AND T2.staff_last_name = "Weber" |
Which problems were reported by the staff named Dameon Frami or Jolie Weber? Give me the ids of the problems. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problems were reported by the staff named Dameon Frami or Jolie Weber? Give me the ids of the problems.` to a syntactically-correct PostgreSQL query.
| SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Jolie" AND T2.staff_last_name = "Weber" |
What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?` to a syntactically-correct PostgreSQL query.
| SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" AND T2.staff_last_name = "Berge" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Ashley" AND T2.staff_last_name = "Medhurst" |
For which product was there a problem reported by Christop Berge, with closure authorised by Ashley Medhurst? Return the product ids. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 which product was there a problem reported by Christop Berge, with closure authorised by Ashley Medhurst? Return the product ids.` to a syntactically-correct PostgreSQL query.
| SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" AND T2.staff_last_name = "Berge" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Ashley" AND T2.staff_last_name = "Medhurst" |
What are the ids of the problems reported before the date of any problem reported by Lysanne Turcotte? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems reported before the date of any problem reported by Lysanne Turcotte?` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Lysanne" AND T4.staff_last_name = "Turcotte" ) |
Which problems were reported before the date of any problem reported by the staff Lysanne Turcotte? Give me the ids of the problems. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 problems were reported before the date of any problem reported by the staff Lysanne Turcotte? Give me the ids of the problems.` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Lysanne" AND T4.staff_last_name = "Turcotte" ) |
What are the ids of the problems reported after the date of any problems reported by Rylan Homenick? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems reported after the date of any problems reported by Rylan Homenick?` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > ( SELECT max(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Rylan" AND T4.staff_last_name = "Homenick" ) |
Find the ids of the problems reported after the date of any problems reported by the staff Rylan Homenick. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems reported after the date of any problems reported by the staff Rylan Homenick.` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > ( SELECT max(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Rylan" AND T4.staff_last_name = "Homenick" ) |
Find the top 3 products which have the largest number of problems? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 top 3 products which have the largest number of problems?` to a syntactically-correct PostgreSQL query.
| SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3 |
What are the three products that have the most problems?s |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 three products that have the most problems?s` to a syntactically-correct PostgreSQL query.
| SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3 |
List the ids of the problems from the product "voluptatem" that are reported after 1995? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems from the product "voluptatem" that are reported after 1995?` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "voluptatem" AND T1.date_problem_reported > "1995" |
What are the ids of the problems that are from the product "voluptatem" and are reported after 1995? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 ids of the problems that are from the product "voluptatem" and are reported after 1995?` to a syntactically-correct PostgreSQL query.
| SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "voluptatem" AND T1.date_problem_reported > "1995" |
Find the first and last name of the staff members who reported problems from the product "rem" but not "aut"? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 first and last name of the staff members who reported problems from the product "rem" but not "aut"?` to a syntactically-correct PostgreSQL query.
| SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "rem" EXCEPT SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "aut" |
Which staff members who reported problems from the product "rem" but not "aut"? Give me their first and last names. |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 staff members who reported problems from the product "rem" but not "aut"? Give me their first and last names.` to a syntactically-correct PostgreSQL query.
| SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "rem" EXCEPT SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "aut" |
Find the products which have problems reported by both Lacey Bosco and Kenton Champlin? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 products which have problems reported by both Lacey Bosco and Kenton Champlin?` to a syntactically-correct PostgreSQL query.
| SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Lacey" AND T3.staff_last_name = "Bosco" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Kenton" AND T3.staff_last_name = "Champlin" |
Which products have problems reported by both the staff named Lacey Bosco and the staff named Kenton Champlin? |
-- Language PostgreSQL
-- Tables:
-- Table: problem category codes
columns : [['problem category code', 'text'], ['problem category description', 'text']]
-- Table: problem log
columns : [['problem log id', 'number'], ['assigned to staff id', 'number'], ['problem id', 'number'], ['problem category code', 'text'], ['problem status code', 'text'], ['log entry date', 'time'], ['log entry description', 'text'], ['log entry fix', 'text'], ['other log details', 'text']]
-- Table: problem status codes
columns : [['problem status code', 'text'], ['problem status description', 'text']]
-- Table: product
columns : [['product id', 'number'], ['product name', 'text'], ['product details', 'text']]
-- Table: staff
columns : [['staff id', 'number'], ['staff first name', 'text'], ['staff last name', 'text'], ['other staff details', 'text']]
-- Table: problems
columns : [['problem id', 'number'], ['product id', 'number'], ['closure authorised by staff id', 'number'], ['reported by staff id', 'number'], ['date problem reported', 'time'], ['date problem closed', 'time'], ['problem description', 'text'], ['other problem 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 products have problems reported by both the staff named Lacey Bosco and the staff named Kenton Champlin?` to a syntactically-correct PostgreSQL query.
| SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Lacey" AND T3.staff_last_name = "Bosco" INTERSECT SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T3.staff_first_name = "Kenton" AND T3.staff_last_name = "Champlin" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.