text
stringlengths
0
220
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Peterson-Moore for the last quarter?
SQL Query: SELECT p.category, SUM(s.sales) as total_sales
FROM sales s
JOIN products p ON s.product_id = p.product_id
JOIN customers c ON s.customer_id = c.customer_id
WHERE c.age BETWEEN 25 AND 35
AND s.company_name = 'Peterson-Moore'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: List all customers and their total order value for Douglas, Bryant and Carr.
SQL Query: SELECT c.customer_name, SUM(o.order_total) as total_value FROM customers c JOIN orders o ON c.customer_id = o.customer_id WHERE c.company_name = 'Douglas, Bryant and Carr' GROUP BY c.customer_id
Natural Query: What is the average quantity of all products for Stevenson LLC?
SQL Query: SELECT AVERAGE(quantity) as result FROM products WHERE company_name = 'Stevenson LLC'
Natural Query: What are the top 5 products by sales for Gallegos and Sons all time?
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Gallegos and Sons' AND period = 'all time' GROUP BY product_name ORDER BY total_sales DESC LIMIT 5
Natural Query: List all customers and their total order value for Gibson-Carney.
SQL Query: SELECT c.customer_name, SUM(o.order_total) as total_value FROM customers c JOIN orders o ON c.customer_id = o.customer_id WHERE c.company_name = 'Gibson-Carney' GROUP BY c.customer_id
Natural Query: Show me all products in the including category with a price over $798.55.
SQL Query: SELECT * FROM products WHERE category = 'including' AND price > 798.55
Natural Query: What is the total quantity for each category in Johnson PLC?
SQL Query: SELECT category, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Johnson PLC' GROUP BY category ORDER BY total_quantity DESC
Natural Query: How many orders were placed for Hernandez PLC between 2024-08-23 and 2024-09-10?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Hernandez PLC' AND order_date BETWEEN '2024-08-23' AND '2024-09-10'
Natural Query: How many orders were placed for Christensen-Ingram between 2024-06-23 and 2024-08-04?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Christensen-Ingram' AND order_date BETWEEN '2024-06-23' AND '2024-08-04'
Natural Query: What are the top 7 products by customers for Ramirez PLC this month?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Ramirez PLC' AND period = 'this month' GROUP BY product_name ORDER BY total_customers DESC LIMIT 7
Natural Query: Show me all products in the hospital category with a price over $290.86.
SQL Query: SELECT * FROM products WHERE category = 'hospital' AND price > 290.86
Natural Query: What is the total quantity for each country in Garcia, Simmons and Hensley?
SQL Query: SELECT country, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Garcia, Simmons and Hensley' GROUP BY country ORDER BY total_quantity DESC
Natural Query: What is the maximum quantity of all products for Rodriguez LLC?
SQL Query: SELECT MAXIMUM(quantity) as result FROM products WHERE company_name = 'Rodriguez LLC'
Natural Query: List all customers and their total order value for Parrish, Craig and Chen.
SQL Query: SELECT c.customer_name, SUM(o.order_total) as total_value FROM customers c JOIN orders o ON c.customer_id = o.customer_id WHERE c.company_name = 'Parrish, Craig and Chen' GROUP BY c.customer_id
Natural Query: List all customers and their total order value for James-Cox.
SQL Query: SELECT c.customer_name, SUM(o.order_total) as total_value FROM customers c JOIN orders o ON c.customer_id = o.customer_id WHERE c.company_name = 'James-Cox' GROUP BY c.customer_id
Natural Query: What are the top 7 products by revenue for Wright Inc last quarter?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Wright Inc' AND period = 'last quarter' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 7
Natural Query: Show me all products in the raise category with a price over $438.09.
SQL Query: SELECT * FROM products WHERE category = 'raise' AND price > 438.09
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Montgomery, Hall and Pugh for the last quarter?
SQL Query: SELECT p.category, SUM(s.sales) as total_sales
FROM sales s
JOIN products p ON s.product_id = p.product_id
JOIN customers c ON s.customer_id = c.customer_id
WHERE c.age BETWEEN 25 AND 35
AND s.company_name = 'Montgomery, Hall and Pugh'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: What is the total profit for each country in Garcia-Bryant?
SQL Query: SELECT country, SUM(profit) as total_profit FROM sales WHERE company_name = 'Garcia-Bryant' GROUP BY country ORDER BY total_profit DESC
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Stewart, Roberts and Allen for the last quarter?
SQL Query: SELECT p.category, SUM(s.sales) as total_sales
FROM sales s
JOIN products p ON s.product_id = p.product_id
JOIN customers c ON s.customer_id = c.customer_id
WHERE c.age BETWEEN 25 AND 35
AND s.company_name = 'Stewart, Roberts and Allen'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: What are the top 8 products by customers for Johnson-Johnson last quarter?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Johnson-Johnson' AND period = 'last quarter' GROUP BY product_name ORDER BY total_customers DESC LIMIT 8
Natural Query: Show me all products in the social category with a price over $158.45.
SQL Query: SELECT * FROM products WHERE category = 'social' AND price > 158.45
Natural Query: What is the total quantity for each supplier in Kelly, Byrd and Kennedy?
SQL Query: SELECT supplier, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Kelly, Byrd and Kennedy' GROUP BY supplier ORDER BY total_quantity DESC
Natural Query: What is the total sales for each supplier in Ware Inc?
SQL Query: SELECT supplier, SUM(sales) as total_sales FROM sales WHERE company_name = 'Ware Inc' GROUP BY supplier ORDER BY total_sales DESC