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 = 'Townsend 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 are the top 5 categories by sales for customers aged 25-35 in Stone, Green and Herrera 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 = 'Stone, Green and Herrera' |
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 Bates 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 = 'Bates and Sons' GROUP BY c.customer_id |
Natural Query: List all customers and their total order value for Jackson-Stevens. |
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 = 'Jackson-Stevens' GROUP BY c.customer_id |
Natural Query: What is the maximum rating of all products for Ramirez, Bennett and Griffin? |
SQL Query: SELECT MAXIMUM(rating) as result FROM products WHERE company_name = 'Ramirez, Bennett and Griffin' |
Natural Query: List all products of Ramirez, Spears and Griffin ordered by stock_quantity from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Ramirez, Spears and Griffin' ORDER BY stock_quantity DESC |
Natural Query: Show me all products in the food category with a price over $604.72. |
SQL Query: SELECT * FROM products WHERE category = 'food' AND price > 604.72 |
Natural Query: Show me all products in the way category with a price over $225.4. |
SQL Query: SELECT * FROM products WHERE category = 'way' AND price > 225.4 |
Natural Query: What is the total quantity for each supplier in Gilbert Ltd? |
SQL Query: SELECT supplier, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Gilbert Ltd' GROUP BY supplier ORDER BY total_quantity DESC |
Natural Query: What are the top 8 products by revenue for Alvarez PLC last quarter? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Alvarez PLC' AND period = 'last quarter' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 8 |
Natural Query: How many orders were placed for Anderson Ltd between 2024-04-06 and 2024-06-23? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Anderson Ltd' AND order_date BETWEEN '2024-04-06' AND '2024-06-23' |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Lyons 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 = 'Lyons LLC' |
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 Lewis LLC ordered by stock_quantity from lowest to highest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Lewis LLC' ORDER BY stock_quantity ASC |
Natural Query: What are the top 5 products by revenue for Strong, Ford and Holden this year? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Strong, Ford and Holden' AND period = 'this year' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 5 |
Natural Query: What is the total quantity for each supplier in Smith, Fuller and Cooper? |
SQL Query: SELECT supplier, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Smith, Fuller and Cooper' GROUP BY supplier ORDER BY total_quantity DESC |
Natural Query: What is the total quantity for each supplier in Carter-Brooks? |
SQL Query: SELECT supplier, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Carter-Brooks' GROUP BY supplier ORDER BY total_quantity DESC |
Natural Query: What is the total profit for each category in Cortez PLC? |
SQL Query: SELECT category, SUM(profit) as total_profit FROM sales WHERE company_name = 'Cortez PLC' GROUP BY category ORDER BY total_profit DESC |
Natural Query: What are the top 5 products by orders for Taylor Group this month? |
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Taylor Group' AND period = 'this month' GROUP BY product_name ORDER BY total_orders DESC LIMIT 5 |
Natural Query: How many orders were placed for Webb, Wagner and Martin between 2024-08-13 and 2024-08-26? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Webb, Wagner and Martin' AND order_date BETWEEN '2024-08-13' AND '2024-08-26' |
Natural Query: List all products of Barrett, Jones and Gutierrez ordered by stock_quantity from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Barrett, Jones and Gutierrez' ORDER BY stock_quantity DESC |
Natural Query: List all customers and their total order value for Hughes, Stein and Daniel. |
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 = 'Hughes, Stein and Daniel' GROUP BY c.customer_id |
Natural Query: What are the top 5 products by revenue for Hunt-Spencer all time? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Hunt-Spencer' AND period = 'all time' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 5 |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Stevens-Baker 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 = 'Stevens-Baker' |
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.