text
stringlengths
0
220
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 = 'Davenport-Bennett'
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 5 categories by sales for customers aged 25-35 in Holden, Bush and Mitchell 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 = 'Holden, Bush and Mitchell'
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
GROUP BY p.category
ORDER BY total_sales DESC
LIMIT 5
Natural Query: How many orders were placed for Dennis-Camacho between 2024-05-21 and 2024-06-30?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Dennis-Camacho' AND order_date BETWEEN '2024-05-21' AND '2024-06-30'
Natural Query: List all products of Carter-Golden ordered by price from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Carter-Golden' ORDER BY price ASC
Natural Query: What are the top 8 products by customers for Holmes-Rodriguez last quarter?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Holmes-Rodriguez' AND period = 'last quarter' GROUP BY product_name ORDER BY total_customers DESC LIMIT 8
Natural Query: List all customers and their total order value for Wilson-English.
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 = 'Wilson-English' GROUP BY c.customer_id
Natural Query: What are the top 6 products by customers for Ward-Hunt all time?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Ward-Hunt' AND period = 'all time' GROUP BY product_name ORDER BY total_customers DESC LIMIT 6
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Berry Inc 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 = 'Berry Inc'
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 6 products by customers for Lee, Walker and Perry this month?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Lee, Walker and Perry' AND period = 'this month' GROUP BY product_name ORDER BY total_customers DESC LIMIT 6
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Floyd Group 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 = 'Floyd Group'
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 Jones, Munoz and Stewart?
SQL Query: SELECT AVERAGE(rating) as result FROM products WHERE company_name = 'Jones, Munoz and Stewart'
Natural Query: What is the maximum rating of all products for Swanson, Becker and Miller?
SQL Query: SELECT MAXIMUM(rating) as result FROM products WHERE company_name = 'Swanson, Becker and Miller'
Natural Query: What are the top 3 products by customers for Mills, Crane and White last quarter?
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Mills, Crane and White' AND period = 'last quarter' GROUP BY product_name ORDER BY total_customers DESC LIMIT 3
Natural Query: List all products of Pearson Group ordered by stock_quantity from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Pearson Group' ORDER BY stock_quantity ASC
Natural Query: What are the top 8 products by revenue for Reeves LLC this month?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Reeves LLC' AND period = 'this month' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 8
Natural Query: What is the total sales for each category in Smith-Reese?
SQL Query: SELECT category, SUM(sales) as total_sales FROM sales WHERE company_name = 'Smith-Reese' GROUP BY category ORDER BY total_sales DESC
Natural Query: List all customers and their total order value for Martin, Lawson and Orozco.
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 = 'Martin, Lawson and Orozco' GROUP BY c.customer_id
Natural Query: What is the minimum rating of all products for West PLC?
SQL Query: SELECT MINIMUM(rating) as result FROM products WHERE company_name = 'West PLC'
Natural Query: What are the top 8 products by revenue for Brown-Davis this year?
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Brown-Davis' AND period = 'this year' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 8
Natural Query: Show me all products in the serious category with a price over $382.44.
SQL Query: SELECT * FROM products WHERE category = 'serious' AND price > 382.44
Natural Query: How many orders were placed for Stuart PLC between 2024-05-30 and 2024-09-05?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Stuart PLC' AND order_date BETWEEN '2024-05-30' AND '2024-09-05'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Parker, Rodriguez and Lane for the last quarter?
SQL Query: SELECT p.category, SUM(s.sales) as total_sales