text
stringlengths
0
220
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Hernandez-Hinton 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 = 'Hernandez-Hinton'
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 Bailey-Ramirez 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 = 'Bailey-Ramirez'
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 Frye and Sons between 2023-09-24 and 2023-10-18?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Frye and Sons' AND order_date BETWEEN '2023-09-24' AND '2023-10-18'
Natural Query: How many orders were placed for Nichols Group between 2024-01-25 and 2024-07-17?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Nichols Group' AND order_date BETWEEN '2024-01-25' AND '2024-07-17'
Natural Query: How many orders were placed for Mitchell-Logan between 2024-04-21 and 2024-05-13?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Mitchell-Logan' AND order_date BETWEEN '2024-04-21' AND '2024-05-13'
Natural Query: How many orders were placed for Walker Inc between 2024-06-10 and 2024-07-16?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Walker Inc' AND order_date BETWEEN '2024-06-10' AND '2024-07-16'
Natural Query: List all customers and their total order value for Krueger-Fowler.
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 = 'Krueger-Fowler' GROUP BY c.customer_id
Natural Query: List all products of Nelson-Murphy ordered by price from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Nelson-Murphy' ORDER BY price ASC
Natural Query: What is the minimum rating of all products for Wyatt-Lee?
SQL Query: SELECT MINIMUM(rating) as result FROM products WHERE company_name = 'Wyatt-Lee'
Natural Query: How many orders were placed for Hale, Thomas and Smith between 2024-07-19 and 2024-08-04?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Hale, Thomas and Smith' AND order_date BETWEEN '2024-07-19' AND '2024-08-04'
Natural Query: What is the total quantity for each category in Joseph PLC?
SQL Query: SELECT category, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Joseph PLC' GROUP BY category ORDER BY total_quantity DESC
Natural Query: What is the maximum price of all products for Colon LLC?
SQL Query: SELECT MAXIMUM(price) as result FROM products WHERE company_name = 'Colon LLC'
Natural Query: What is the average price of all products for Richardson Group?
SQL Query: SELECT AVERAGE(price) as result FROM products WHERE company_name = 'Richardson Group'
Natural Query: List all customers and their total order value for Huang-White.
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 = 'Huang-White' GROUP BY c.customer_id
Natural Query: List all customers and their total order value for Tran, Campos and Marshall.
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 = 'Tran, Campos and Marshall' GROUP BY c.customer_id
Natural Query: What are the top 10 products by sales for Robinson Inc last quarter?
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Robinson Inc' AND period = 'last quarter' GROUP BY product_name ORDER BY total_sales DESC LIMIT 10
Natural Query: List all products of Elliott Ltd ordered by price from highest to lowest.
SQL Query: SELECT * FROM products WHERE company_name = 'Elliott Ltd' ORDER BY price DESC
Natural Query: How many orders were placed for Haynes, Berger and Smith between 2024-02-06 and 2024-07-19?
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Haynes, Berger and Smith' AND order_date BETWEEN '2024-02-06' AND '2024-07-19'
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Goodman, Todd and Walton 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 = 'Goodman, Todd and Walton'
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 King 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 = 'King PLC'
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 Mata-Booker ordered by stock_quantity from lowest to highest.
SQL Query: SELECT * FROM products WHERE company_name = 'Mata-Booker' ORDER BY stock_quantity ASC
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Davenport-Bennett for the last quarter?