Query Selector
Select all categoriesDescription: Retrieves all records from the categories table.Query: SELECT * FROM categories;
Select products with unit price greater than 50Description: Retrieves products from the products table where the unit price is greater than 50.Query: SELECT * FROM products WHERE unitPrice > 50;
Select orders placed in a specific regionDescription: Retrieves orders from the orders table that were shipped to a specific region.Query: SELECT * FROM orders WHERE shipRegion = 'North';
Count the number of products in each categoryDescription: Counts the number of products in each category from the products table.Query: SELECT categoryID, COUNT(*) as productCount FROM products GROUP BY categoryID;
Find the average unit price of productsDescription: Calculates the average unit price of products from the products table.Query: SELECT AVG(unitPrice) as averagePrice FROM products;
List customers and their ordersDescription: Retrieves customer information along with their associated orders from the customers and orders tables using a join operation.Query: SELECT customers.customerID, customers.companyName, orders.orderID FROM customers INNER JOIN orders ON customers.customerID = orders.customerID;
Find the total sales for each productDescription: Calculates the total sales for each product by multiplying the unit price with the quantity from the order_details table.Query: SELECT productID, SUM(unitPrice*quantity) as totalSales FROM order_details GROUP BY productID;
Find employees who have territoriesDescription: Retrieves employee information for those who have territories assigned from the employees and employee_territories tables using a join operation.Query: SELECT employees.employeeID, employees.firstName, employees.lastName FROM employees INNER JOIN employee_territories ON employees.employeeID = employee_territories.employeeID;
List suppliers and their productsDescription: Retrieves supplier information along with the products they supply from the suppliers and products tables using a join operation.Query: SELECT suppliers.supplierID, suppliers.companyName, products.productName FROM suppliers INNER JOIN products ON suppliers.supplierID = products.supplierID;
Find the shipper with the most ordersDescription: Identifies the shipper with the highest number of orders from the orders table.Query: SELECT shipVia, COUNT(*) as orderCount FROM orders GROUP BY shipVia ORDER BY orderCount DESC LIMIT 1;
Retrieve customers from a specific countryDescription: Retrieves customer records from a specific country (e.g., USA) from the customers table.Query: SELECT * FROM customers WHERE country = 'USA';
List products and their categoriesDescription: Retrieves product names along with their associated categories from the products and categories tables using a join operation.Query: SELECT products.productName, categories.categoryName FROM products INNER JOIN categories ON products.categoryID = categories.categoryID;
Result
Please execute a query
