Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1: Using OES4 database, redo the following two queries (you did them in assignment 4) with PL/SQL: 1. List number of orders for each
Part 1: Using OES4 database, redo the following two queries (you did them in assignment 4) with PL/SQL: 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 2. 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.List TOP 25% of employees (employee number, employee last name) based on total net sales ( their total subtotal - their total amount returned) 4. List all product categories and total amount of products sold for each category for every year YEAR PRODUCT_CATEGORY AMT_SOLD Part2: Using OES4, answer the following queries with stored procedures 4 Create several procedures to accept product number and produce the following result a. Procedure Get_Product_Num_Cust i. Receives product number as input and produces total purchase from customers for that product as output b. Procedure Get_Product_Cust_Purchases i. Receives Product number as input and produces total net purchases by all customer of that product as output c. Procedure Get_product_Num_orders i. Receives product number and year as input and produces number of orders by all customers for that product for the year as output 5 Develop a driver program to call all the 5 above procedures and produce the following report PRODUCT\#, TOTAL_SALES, TOTAL_NUMBER_ORDERS Note: Net sales=Total_sales_amount - total_return_amount Use RPAD or LPAD to develop your report art3: Using OES4, answer the following queries with user defined functions 6. Create several user defined functions to accept product number and produce the following result a. Function Get_Product_Num_Cust i. Receives product number as input and produces total purchase from customers for that product as output b. Function Get_Product_Cust_Purchases i. Receives Product number as input and produces total net purchases by all customer of that product as output c. Function Get_product_Num_orders i. Receives product number as input and produces number of orders by all customers for that product for the year as output
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