text stringlengths 0 220 |
|---|
Natural Query: What are the top 10 products by customers for Smith, Hamilton and Davis all time? |
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Smith, Hamilton and Davis' AND period = 'all time' GROUP BY product_name ORDER BY total_customers DESC LIMIT 10 |
Natural Query: What is the maximum price of all products for Moore, Anderson and Brown? |
SQL Query: SELECT MAXIMUM(price) as result FROM products WHERE company_name = 'Moore, Anderson and Brown' |
Natural Query: List all customers and their total order value for Miller, Burnett and Jimenez. |
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 = 'Miller, Burnett and Jimenez' GROUP BY c.customer_id |
Natural Query: What is the total quantity for each country in Carter-Powell? |
SQL Query: SELECT country, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Carter-Powell' GROUP BY country ORDER BY total_quantity DESC |
Natural Query: What is the total quantity of all products for Smith Inc? |
SQL Query: SELECT TOTAL(quantity) as result FROM products WHERE company_name = 'Smith Inc' |
Natural Query: What is the total profit for each supplier in Williams, Powell and Wilson? |
SQL Query: SELECT supplier, SUM(profit) as total_profit FROM sales WHERE company_name = 'Williams, Powell and Wilson' GROUP BY supplier ORDER BY total_profit DESC |
Natural Query: What is the total quantity for each country in Horton Group? |
SQL Query: SELECT country, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Horton Group' GROUP BY country ORDER BY total_quantity DESC |
Natural Query: List all customers and their total order value for Davis, Higgins and Green. |
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 = 'Davis, Higgins and Green' GROUP BY c.customer_id |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Welch, Moore and 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 = 'Welch, Moore and Brown' |
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 Smith PLC this month? |
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Smith PLC' AND period = 'this month' GROUP BY product_name ORDER BY total_customers DESC LIMIT 6 |
Natural Query: List all products of Long and Sons ordered by price from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Long and Sons' ORDER BY price DESC |
Natural Query: How many orders were placed for Miller-Young between 2024-01-03 and 2024-04-24? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Miller-Young' AND order_date BETWEEN '2024-01-03' AND '2024-04-24' |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Lloyd 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 = 'Lloyd Inc' |
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 Peters-Baird between 2024-01-04 and 2024-08-10? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Peters-Baird' AND order_date BETWEEN '2024-01-04' AND '2024-08-10' |
Natural Query: List all customers and their total order value for Leach, Warner and Gonzales. |
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 = 'Leach, Warner and Gonzales' GROUP BY c.customer_id |
Natural Query: List all products of Howard and Sons ordered by stock_quantity from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Howard and Sons' ORDER BY stock_quantity DESC |
Natural Query: Show me all products in the local category with a price over $692.61. |
SQL Query: SELECT * FROM products WHERE category = 'local' AND price > 692.61 |
Natural Query: What is the total sales for each supplier in Martinez-Cantu? |
SQL Query: SELECT supplier, SUM(sales) as total_sales FROM sales WHERE company_name = 'Martinez-Cantu' GROUP BY supplier ORDER BY total_sales DESC |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Strickland, Duncan and Strong 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 = 'Strickland, Duncan and Strong' |
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 quantity of all products for Stevens-Hamilton? |
SQL Query: SELECT AVERAGE(quantity) as result FROM products WHERE company_name = 'Stevens-Hamilton' |
Natural Query: Show me all products in the sort category with a price over $69.9. |
SQL Query: SELECT * FROM products WHERE category = 'sort' AND price > 69.9 |
Natural Query: Show me all products in the reach category with a price over $633.6. |
SQL Query: SELECT * FROM products WHERE category = 'reach' AND price > 633.6 |
Natural Query: Show me all products in the not category with a price over $430.16. |
SQL Query: SELECT * FROM products WHERE category = 'not' AND price > 430.16 |
Natural Query: List all customers and their total order value for Brown, Porter and Hampton. |
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 = 'Brown, Porter and Hampton' GROUP BY c.customer_id |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.