text
stringlengths
0
220
Natural Query: What are the top 7 products by orders for Harper PLC this month?
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Harper PLC' AND period = 'this month' GROUP BY product_name ORDER BY total_orders DESC LIMIT 7
Natural Query: How many orders were placed for Martin-Russell between 2024-03-07 and 2024-05-16?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Martin-Russell' AND order_date BETWEEN '2024-03-07' AND '2024-05-16'
Natural Query: List all products of Sharp, Burke and Roberts ordered by rating from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Sharp, Burke and Roberts' ORDER BY rating ASC
Natural Query: List all customers and their total order value for Jensen-Fry.
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 = 'Jensen-Fry' GROUP BY c.customer_id
Natural Query: How many orders were placed for Smith Group between 2024-04-26 and 2024-06-20?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Smith Group' AND order_date BETWEEN '2024-04-26' AND '2024-06-20'
Natural Query: How many orders were placed for Morton, Jefferson and Owens between 2024-06-11 and 2024-08-07?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Morton, Jefferson and Owens' AND order_date BETWEEN '2024-06-11' AND '2024-08-07'
Natural Query: Show me all products in the husband category with a price over $644.71.
SQL Query: SELECT * FROM products WHERE category = 'husband' AND price > 644.71
Natural Query: What are the top 7 products by orders for Nash-Wilson all time?
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Nash-Wilson' AND period = 'all time' GROUP BY product_name ORDER BY total_orders DESC LIMIT 7
Natural Query: How many orders were placed for Jackson PLC between 2024-02-18 and 2024-03-27?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Jackson PLC' AND order_date BETWEEN '2024-02-18' AND '2024-03-27'
Natural Query: What is the average price of all products for Johnson Group?
SQL Query: SELECT AVERAGE(price) as result FROM products WHERE company_name = 'Johnson Group'
Natural Query: What is the total profit for each category in Anderson, Keller and Stewart?
SQL Query: SELECT category, SUM(profit) as total_profit FROM sales WHERE company_name = 'Anderson, Keller and Stewart' GROUP BY category ORDER BY total_profit DESC
Natural Query: What is the maximum price of all products for Spencer-Riley?
SQL Query: SELECT MAXIMUM(price) as result FROM products WHERE company_name = 'Spencer-Riley'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in James PLC 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 = 'James PLC'
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 Dunn-Luna 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 = 'Dunn-Luna'
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 Moore-Oliver.
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 = 'Moore-Oliver' GROUP BY c.customer_id
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Hill-Robertson 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 = 'Hill-Robertson'
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 quantity of all products for Gardner and Sons?
SQL Query: SELECT TOTAL(quantity) as result FROM products WHERE company_name = 'Gardner and Sons'
Natural Query: What is the total sales for each supplier in Parrish-Davies?
SQL Query: SELECT supplier, SUM(sales) as total_sales FROM sales WHERE company_name = 'Parrish-Davies' GROUP BY supplier ORDER BY total_sales DESC
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Cruz, Johnson and Murray 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 = 'Cruz, Johnson and Murray'
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 price of all products for Wilson-Mcguire?
SQL Query: SELECT TOTAL(price) as result FROM products WHERE company_name = 'Wilson-Mcguire'
Natural Query: List all customers and their total order value for Potter, Golden and Smith.
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 = 'Potter, Golden and Smith' GROUP BY c.customer_id