text stringlengths 0 220 |
|---|
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 = 'Brown Ltd' |
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 Miller PLC between 2024-05-26 and 2024-08-19? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Miller PLC' AND order_date BETWEEN '2024-05-26' AND '2024-08-19' |
Natural Query: Show me all products in the strategy category with a price over $516.18. |
SQL Query: SELECT * FROM products WHERE category = 'strategy' AND price > 516.18 |
Natural Query: What are the top 7 products by orders for Willis PLC all time? |
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Willis PLC' AND period = 'all time' GROUP BY product_name ORDER BY total_orders DESC LIMIT 7 |
Natural Query: List all customers and their total order value for Baker-Watkins. |
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 = 'Baker-Watkins' GROUP BY c.customer_id |
Natural Query: Show me all products in the mother category with a price over $227.75. |
SQL Query: SELECT * FROM products WHERE category = 'mother' AND price > 227.75 |
Natural Query: List all products of Acosta, Green and Wyatt ordered by price from lowest to highest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Acosta, Green and Wyatt' ORDER BY price ASC |
Natural Query: What are the top 3 products by revenue for George, Flynn and Gray last quarter? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'George, Flynn and Gray' AND period = 'last quarter' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 3 |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Morrow-Campbell 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 = 'Morrow-Campbell' |
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 8 products by revenue for Bates-Martin this year? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Bates-Martin' AND period = 'this year' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 8 |
Natural Query: List all products of Rodriguez-Dawson ordered by stock_quantity from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Rodriguez-Dawson' ORDER BY stock_quantity DESC |
Natural Query: List all products of Petersen and Sons ordered by price from lowest to highest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Petersen and Sons' ORDER BY price ASC |
Natural Query: List all products of Wilson-Alvarado ordered by stock_quantity from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Wilson-Alvarado' ORDER BY stock_quantity DESC |
Natural Query: List all customers and their total order value for Sims-Thomas. |
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 = 'Sims-Thomas' GROUP BY c.customer_id |
Natural Query: What is the total quantity for each category in Martin, Weber and Daniel? |
SQL Query: SELECT category, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Martin, Weber and Daniel' GROUP BY category ORDER BY total_quantity DESC |
Natural Query: List all customers and their total order value for Alexander, Rowland and Brock. |
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 = 'Alexander, Rowland and Brock' GROUP BY c.customer_id |
Natural Query: Show me all products in the management category with a price over $699.4. |
SQL Query: SELECT * FROM products WHERE category = 'management' AND price > 699.4 |
Natural Query: What are the top 6 products by revenue for Whitaker Inc last quarter? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Whitaker Inc' AND period = 'last quarter' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 6 |
Natural Query: List all products of Smith-Brandt ordered by rating from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Smith-Brandt' ORDER BY rating DESC |
Natural Query: What is the average price of all products for Martin PLC? |
SQL Query: SELECT AVERAGE(price) as result FROM products WHERE company_name = 'Martin PLC' |
Natural Query: How many orders were placed for Sandoval, Cervantes and Watkins between 2023-10-08 and 2024-05-24? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Sandoval, Cervantes and Watkins' AND order_date BETWEEN '2023-10-08' AND '2024-05-24' |
Natural Query: What are the top 5 products by sales for Patterson-Brown this year? |
SQL Query: SELECT product_name, SUM(sales) as total_sales FROM sales WHERE company_name = 'Patterson-Brown' AND period = 'this year' GROUP BY product_name ORDER BY total_sales DESC LIMIT 5 |
Natural Query: What is the total quantity for each supplier in Edwards-Kelly? |
SQL Query: SELECT supplier, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Edwards-Kelly' GROUP BY supplier ORDER BY total_quantity DESC |
Natural Query: List all products of Baird-Brown ordered by rating from lowest to highest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Baird-Brown' ORDER BY rating ASC |
Natural Query: List all products of Perry, Martin and Clark ordered by rating from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Perry, Martin and Clark' ORDER BY rating DESC |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Carter 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 = 'Carter PLC' |
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH) |
GROUP BY p.category |
ORDER BY total_sales DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.