text
stringlengths
0
220
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Padilla, Kelly and Collins 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 = 'Padilla, Kelly and Collins'
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 category in Edwards Group?
SQL Query: SELECT category, SUM(profit) as total_profit FROM sales WHERE company_name = 'Edwards Group' GROUP BY category ORDER BY total_profit DESC
Natural Query: Show me all products in the exist category with a price over $347.91.
SQL Query: SELECT * FROM products WHERE category = 'exist' AND price > 347.91
Natural Query: What is the total sales for each country in Rivera and Sons?
SQL Query: SELECT country, SUM(sales) as total_sales FROM sales WHERE company_name = 'Rivera and Sons' GROUP BY country ORDER BY total_sales DESC
Natural Query: What are the top 4 products by revenue for Scott, James and Townsend last quarter?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Scott, James and Townsend' AND period = 'last quarter' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 4
Natural Query: How many orders were placed for Sanchez-Norton between 2024-05-04 and 2024-08-27?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Sanchez-Norton' AND order_date BETWEEN '2024-05-04' AND '2024-08-27'
Natural Query: What is the average quantity of all products for Petty, Watson and Bartlett?
SQL Query: SELECT AVERAGE(quantity) as result FROM products WHERE company_name = 'Petty, Watson and Bartlett'
Natural Query: What are the top 10 products by revenue for Thomas, Kelley and Obrien this year?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Thomas, Kelley and Obrien' AND period = 'this year' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 10
Natural Query: What are the top 10 products by revenue for Johnson, Burns and Boyd last quarter?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Johnson, Burns and Boyd' AND period = 'last quarter' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 10
Natural Query: List all customers and their total order value for Reed Group.
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 = 'Reed Group' GROUP BY c.customer_id
Natural Query: How many orders were placed for Fowler-Holland between 2024-03-28 and 2024-04-08?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Fowler-Holland' AND order_date BETWEEN '2024-03-28' AND '2024-04-08'
Natural Query: List all customers and their total order value for Meyer, Arnold and Garcia.
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 = 'Meyer, Arnold and Garcia' GROUP BY c.customer_id
Natural Query: What are the top 10 products by sales for Horn-Ward this month?
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Horn-Ward' AND period = 'this month' GROUP BY product_name ORDER BY total_sales DESC LIMIT 10
Natural Query: Show me all products in the commercial category with a price over $943.17.
SQL Query: SELECT * FROM products WHERE category = 'commercial' AND price > 943.17
Natural Query: Show me all products in the amount category with a price over $745.86.
SQL Query: SELECT * FROM products WHERE category = 'amount' AND price > 745.86
Natural Query: List all customers and their total order value for Butler-Case.
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 = 'Butler-Case' GROUP BY c.customer_id
Natural Query: List all products of Martin, Abbott and Smith ordered by stock_quantity from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Martin, Abbott and Smith' ORDER BY stock_quantity DESC
Natural Query: How many orders were placed for Garcia-Martinez between 2023-09-29 and 2024-06-01?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Garcia-Martinez' AND order_date BETWEEN '2023-09-29' AND '2024-06-01'
Natural Query: List all customers and their total order value for Koch-Maynard.
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 = 'Koch-Maynard' GROUP BY c.customer_id
Natural Query: What is the total profit for each supplier in Watson, Lewis and Bauer?
SQL Query: SELECT supplier, SUM(profit) as total_profit FROM sales WHERE company_name = 'Watson, Lewis and Bauer' GROUP BY supplier ORDER BY total_profit DESC
Natural Query: List all customers and their total order value for Guzman-Day.
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 = 'Guzman-Day' GROUP BY c.customer_id
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Wilson, Miller and Ware 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 = 'Wilson, Miller and Ware'
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 average rating of all products for Green Inc?
SQL Query: SELECT AVERAGE(rating) as result FROM products WHERE company_name = 'Green Inc'
Natural Query: Show me all products in the clearly category with a price over $412.21.
SQL Query: SELECT * FROM products WHERE category = 'clearly' AND price > 412.21
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in King-Bryant 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 = 'King-Bryant'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC