text stringlengths 0 220 |
|---|
SQL Query: SELECT supplier, SUM(sales) as total_sales FROM sales WHERE company_name = 'Smith-Morse' GROUP BY supplier ORDER BY total_sales DESC |
Natural Query: What are the top 9 products by revenue for Smith Group this month? |
SQL Query: SELECT product_name, SUM(revenue) as total_revenue FROM sales WHERE company_name = 'Smith Group' AND period = 'this month' GROUP BY product_name ORDER BY total_revenue DESC LIMIT 9 |
Natural Query: List all customers and their total order value for Wallace, Williamson and Rhodes. |
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 = 'Wallace, Williamson and Rhodes' GROUP BY c.customer_id |
Natural Query: Show me all products in the business category with a price over $863.94. |
SQL Query: SELECT * FROM products WHERE category = 'business' AND price > 863.94 |
Natural Query: Show me all products in the certainly category with a price over $512.69. |
SQL Query: SELECT * FROM products WHERE category = 'certainly' AND price > 512.69 |
Natural Query: What is the total price of all products for Garcia Inc? |
SQL Query: SELECT TOTAL(price) as result FROM products WHERE company_name = 'Garcia Inc' |
Natural Query: List all products of Hart-Smith ordered by stock_quantity from highest to lowest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Hart-Smith' ORDER BY stock_quantity DESC |
Natural Query: List all customers and their total order value for Townsend, Hodge and Cunningham. |
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 = 'Townsend, Hodge and Cunningham' GROUP BY c.customer_id |
Natural Query: List all products of Ryan Group ordered by rating from lowest to highest. |
SQL Query: SELECT * FROM products WHERE company_name = 'Ryan Group' ORDER BY rating ASC |
Natural Query: How many orders were placed for Garcia and Sons between 2024-02-27 and 2024-08-30? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Garcia and Sons' AND order_date BETWEEN '2024-02-27' AND '2024-08-30' |
Natural Query: List all customers and their total order value for Lang, Wells and Ortiz. |
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 = 'Lang, Wells and Ortiz' GROUP BY c.customer_id |
Natural Query: List all customers and their total order value for Steele Ltd. |
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 = 'Steele Ltd' GROUP BY c.customer_id |
Natural Query: What is the total quantity for each supplier in Newman Inc? |
SQL Query: SELECT supplier, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Newman Inc' GROUP BY supplier ORDER BY total_quantity DESC |
Natural Query: List all customers and their total order value for Armstrong, Foster and Graves. |
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 = 'Armstrong, Foster and Graves' GROUP BY c.customer_id |
Natural Query: What is the total quantity for each category in Joseph-Holden? |
SQL Query: SELECT category, SUM(quantity) as total_quantity FROM sales WHERE company_name = 'Joseph-Holden' GROUP BY category ORDER BY total_quantity DESC |
Natural Query: Show me all products in the involve category with a price over $393.81. |
SQL Query: SELECT * FROM products WHERE category = 'involve' AND price > 393.81 |
Natural Query: Show me all products in the growth category with a price over $22.04. |
SQL Query: SELECT * FROM products WHERE category = 'growth' AND price > 22.04 |
Natural Query: What is the maximum rating of all products for Young, Taylor and Sims? |
SQL Query: SELECT MAXIMUM(rating) as result FROM products WHERE company_name = 'Young, Taylor and Sims' |
Natural Query: Show me all products in the happy category with a price over $808.77. |
SQL Query: SELECT * FROM products WHERE category = 'happy' AND price > 808.77 |
Natural Query: List all customers and their total order value for Walker-Diaz. |
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 = 'Walker-Diaz' GROUP BY c.customer_id |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Bailey-Rhodes 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-Rhodes' |
AND s.sale_date >= DATE_SUB(CURDATE(), INTERVAL 3 MONTH) |
GROUP BY p.category |
ORDER BY total_sales DESC |
LIMIT 5 |
Natural Query: Show me all products in the space category with a price over $51.26. |
SQL Query: SELECT * FROM products WHERE category = 'space' AND price > 51.26 |
Natural Query: What are the top 7 products by customers for Escobar-Smith this year? |
SQL Query: SELECT product_name, SUM(customers) as total_customers FROM sales WHERE company_name = 'Escobar-Smith' AND period = 'this year' GROUP BY product_name ORDER BY total_customers DESC LIMIT 7 |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Smith 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 = 'Smith 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 Crane-Jenkins between 2023-09-23 and 2024-02-05? |
SQL Query: SELECT COUNT(*) as order_count FROM orders WHERE company_name = 'Crane-Jenkins' AND order_date BETWEEN '2023-09-23' AND '2024-02-05' |
Natural Query: What are the top 8 products by orders for Norris, Chen and Dean this year? |
SQL Query: SELECT product_name, SUM(orders) as total_orders FROM sales WHERE company_name = 'Norris, Chen and Dean' AND period = 'this year' GROUP BY product_name ORDER BY total_orders DESC LIMIT 8 |
Natural Query: What are the top 5 categories by sales for customers aged 25-35 in Stokes 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.