text
stringlengths
0
220
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Young, Jones and Smith 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 = 'Young, Jones and Smith'
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 products of Herrera, Williams and Bowman ordered by rating from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Herrera, Williams and Bowman' ORDER BY rating ASC
Natural Query: What is the total quantity of all products for Snyder-Wright?
SQL Query: SELECT TOTAL(quantity) as result FROM products WHERE company_name = 'Snyder-Wright'
Natural Query: What are the top 6 products by orders for Pham Inc all time?
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Pham Inc' AND period = 'all time' GROUP BY product_name ORDER BY total_orders DESC LIMIT 6
Natural Query: How many orders were placed for Bennett Group between 2024-09-16 and 2024-09-16?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Bennett Group' AND order_date BETWEEN '2024-09-16' AND '2024-09-16'
Natural Query: Show me all products in the hundred category with a price over $541.27.
SQL Query: SELECT * FROM products WHERE category = 'hundred' AND price > 541.27
Natural Query: List all customers and their total order value for Chavez and Sons.
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 = 'Chavez and Sons' GROUP BY c.customer_id
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Carpenter-Brown 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 = 'Carpenter-Brown'
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 York-Robinson between 2023-09-28 and 2024-06-15?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'York-Robinson' AND order_date BETWEEN '2023-09-28' AND '2024-06-15'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Harris, Jones and Martin 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 = 'Harris, Jones and Martin'
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 7 products by orders for Barber Inc all time?
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Barber Inc' AND period = 'all time' GROUP BY product_name ORDER BY total_orders DESC LIMIT 7
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Cohen-Delacruz 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 = 'Cohen-Delacruz'
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 Smith, Fuller and Meyer 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 = 'Smith, Fuller and Meyer'
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 products of Morgan-Rogers ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Morgan-Rogers' ORDER BY price DESC
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Gilbert LLC 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 = 'Gilbert LLC'
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 sales for each supplier in Smith-Morse?