Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

These questions are to be done in Oracle Live SQL. The ER diagram has been attached below 1. How much total profit was made for

These questions are to be done in Oracle Live SQL. The ER diagram has been attached below

image


1. How much total profit was made for each product sub-category? Display the total profit and the product sub-category by GROUP BY. Rename the total profit in the result as "TOTAL_PROFIT". Sort the result by the total profit in descending order.

 

2. Who are the customers with more than five purchases? Display their customer IDs, the numbers of purchases, the total sales, and the average sales per purchase by HAVING. Rename all fields with new appropriate names. Round up numerical values to 3 decimal places. 

ORDERS Order_ID Order_Date Order_Priority Ord_ld NUMBER(5) DATE VARCHAR2(20) VARCHAR2(10) PRODUCT Prod_id Prod_Category Prod_Sub_Category SHIPPING Ship_ID Order_ID Ship Mode Ship_Date VARCHAR2(20) VARCHAR2(30) VARCHAR2(40) VARCHAR2(10) NUMBER(5) VARCHAR2(20) DATE MARKET Mkt_ld Ord_ld Prod_ld Ship_ld Cust_ld Sales Discount Order Quantity Profit Shipping Cost Product_Base_Margin Figure 3: E/R Diagram of The Order Database NUMBER(6) VARCHAR2(10) VARCHAR2(20) VARCHAR2(10) VARCHAR2(10) NUMBER(10,5) UMBER(8,2) NUMBER(5) NUMBER(8,2) NUMBER(8,2) NUMBER(8,2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals of Investing

Authors: Scott B. Smart, Lawrence J. Gitman, Michael D. Joehnk

12th edition

978-0133075403, 133075354, 9780133423938, 133075400, 013342393X, 978-0133075359

More Books

Students also viewed these Databases questions