Question
Using a database, develop SQL code for the following queries 1. List number of orders for each state with their total purchase (SUBTOTAL), total shipping
Using a database, develop SQL code for the following queries 1. List number of orders for each state with their total purchase (SUBTOTAL), total shipping charge, total tax, and total purchases (there are 15 branches) State, #_ORDERS, TOTAL PURCHAES, TOTAL SHIPPING CHARGES, TOTAL TAXES, TOTAL OVERALL PURCHASE (3) 2. Redo Query 1 using ROLLUP (.5) 3. Redo Query 1 using CUBE. (.5) 4. Redo query 1 by adding Rank to each branch based on total sales (1) 5. Redo query 1 by showing percentage of purchases/ or sales for each branch (2) 6. List number of customers with their total purchases (SUBTOTAL), total shipping charge, total tax, and overall total purchases. CUSTOMER_NO, TOTAL PURCHASES, TOTAL SHIPPING CHARGES, TOTAL TAXES, TOTAL OVERALL PURCHASES (3) 7. Redo Query 6 using ROLLUP (.5) 8. Redo Query 6 using CUBE. (.5) 9. Redo query 6 by adding CUSTOMERS_RANK based on total purchases (2) 10. Redo query 6 by showing percentage of purchases/ or purchases for each state (2) 11. List all product categories and total amount of products sold for each category for every year YEAR PRODUCT_CATEGORY AMT_SOLD 12. List TOP 25% of employees (employee number, employee last name) based on total net sales ( their total subtotal their total amount returned) (3)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started