1. Query for the count of the number of orders and the sum of the tax_amount columns in the Orders table:
SELECT COUNT(*) AS order_count, SUM(tax_amount) AS total_tax_amount
FROM Orders;
2. Query for the category_name, count of products, and the list price of the most expensive product for each category:
SELECT c.category_name, COUNT(p.product_id) AS product_count, MAX(p.list_price) AS max_list_price
FROM Categories c
JOIN Products p ON c.category_id = p.category_id
GROUP BY c.category_name
ORDER BY product_count DESC;
3. Query for the email_address, sum of item price multiplied by quantity, and sum of discount amount multiplied by quantity for each customer with orders:
SELECT c.email_address, SUM(oi.item_price * oi.quantity) AS total_item_price, SUM(oi.discount_amount * oi.quantity) AS total_discount_amount
FROM Customers c
JOIN Orders o ON c.customer_id = o.customer_id
JOIN Order_Items oi ON o.order_id = oi.order_id
GROUP BY c.email_address
ORDER BY total_item_price DESC;
4. Query for the email_address, count of number of orders, and the total amount for each order (price - discount) multiplied by quantity for customers with more than one order:
SELECT c.email_address, COUNT(o.order_id) AS order_count, SUM((oi.item_price - oi.discount_amount) * oi.quantity) AS total_amount
FROM Customers c
JOIN Orders o ON c.customer_id = o.customer_id
JOIN Order_Items oi ON o.order_id = oi.order_id
GROUP BY c.email_address
HAVING COUNT(o.order_id) > 1
ORDER BY total_amount DESC;
replace the table and column names with the appropriate names from your My Guitar Shop database.
Once you have executed these queries, you can capture screenshots of the query and the result set in your database management tool or interface. Make sure to include the current date in the screenshots as required.