(3) Write SQL commands and show the output from Oracle. Your answer must include both SQL...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(3) Write SQL commands and show the output from Oracle. Your answer must include both SQL commands and the output from Oracle. Note that the output from Oracle should be legible. (50) (3-a) For each customer, find the total number of different products he/she purchased and the total amount he/she paid for the products. (3-b) For each customer.city, find the total number of different products purchased from the city and the total amount of dollars paid by the customers living in the city. (3-c) Find the top 5 products in terms of total sales amount. Also display product IDs and Descriptions with the total sales amount. (3-d) Find the top 5 customers in terms of total sales amount. Display customer IDs names and their total sales amounts. (3-e) Find the top 5 customers in terms of the total number of different products they purchased. Display customer IDs, names and their total number of different products.. Employee Employee_id First_name Middle_initial (0) Last_name sex manager_id hire_date salary commision (0) job_code dob Price_hist Product_id (FK) list_price min_price (0) start_date end_date Customer Customer_id Name Address City Ostate zip_code area_code (0) Phone_number (0) salesperson_id (O) (FK) credit_limit (0) comments (0) HH Product Product_id Description Product_code FH- -H-- Sales_order Order_id Customer_id (FK) Shipdate (0) Order_date Total line_item+ Order_id (FK) Item_seq Product_id (FK) Actual_price Quantity SubTotal (3) Write SQL commands and show the output from Oracle. Your answer must include both SQL commands and the output from Oracle. Note that the output from Oracle should be legible. (50) (3-a) For each customer, find the total number of different products he/she purchased and the total amount he/she paid for the products. (3-b) For each customer.city, find the total number of different products purchased from the city and the total amount of dollars paid by the customers living in the city. (3-c) Find the top 5 products in terms of total sales amount. Also display product IDs and Descriptions with the total sales amount. (3-d) Find the top 5 customers in terms of total sales amount. Display customer IDs names and their total sales amounts. (3-e) Find the top 5 customers in terms of the total number of different products they purchased. Display customer IDs, names and their total number of different products.. Employee Employee_id First_name Middle_initial (0) Last_name sex manager_id hire_date salary commision (0) job_code dob Price_hist Product_id (FK) list_price min_price (0) start_date end_date Customer Customer_id Name Address City Ostate zip_code area_code (0) Phone_number (0) salesperson_id (O) (FK) credit_limit (0) comments (0) HH Product Product_id Description Product_code FH- -H-- Sales_order Order_id Customer_id (FK) Shipdate (0) Order_date Total line_item+ Order_id (FK) Item_seq Product_id (FK) Actual_price Quantity SubTotal
Expert Answer:
Answer rating: 100% (QA)
The questions require writing SQL queries based on the given database schema Ill write the SQL commands for each part of the question The results will ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these databases questions
-
OBJECTIVE: To enable learners to utilise the Cost Volume Profit analysis in making informed decisions and cost-effective actions related to the products or services the business sells. REQUIREMENT:...
-
What is the loss function for linear regression-Gradient Descent? How does gradient descent update the estimate, give the general formulae? Given X = [1, 2, 3, 4], and Y = [1.5, 2, 2.5, 5). If we...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
A contract is started on 1 January 2015, with an estimated completion date of 31 December 2016. The final contract price is $1,500,000. In the first year, to 31 December 2015: Costs incurred...
-
Consider a rod of diameter D, thermal conductivity k, and length 2L that is perfectly insulated over one portion of its length, - L
-
The values of L 5 and T 5 ( Level and Trend in this period ) are 2 0 and 1 0 , respectively. Demand is not seasonal. If Holt's model is used, what will be the demand forecast for period 1 5 ?
-
Consider the power function of one-sample z-test shown in Equation (4.3). What is the limit of the power function as $n ightarrow \infty$ ? How about when $\mu_{1} ightarrow \mu_{0}$ ? What do the...
-
The income statements of Evans Company and Falcon Company for the current year are shown below: The following amounts were taken from the statement of changes in equity for the two companies: Evans...
-
Cullumber Company started business on January 1, 2024. Some of the events that occurred in its first year of operations follow: Transactions 1. Equipment that cost $208,400 was purchased on February...
-
A 2 -year bond with a semiannual coupon rate of \(4 \%\) per annum is trading at par \((100 \%)\). (a) What is its spot semiannual yield? (b) Assume one can borrow at \(3 \%\) p.a. simple interest...
-
Suppose that the real rate of interest on a 1-year risk-free bond is constant at 2%. Suppose that people expect the path for year-on-year inflation as in Table 1. 1. Calculate what the yield to...
-
In a certain school, the probabilities of the number of students who are reported tardy are shown in the following table: What is the expected number of tardies (rounded to two decimal places)?...
-
Consider the following table showing the results of a survey of TV network executives. Suppose one network executive is selected at random. Find the indicated probabilities. a. What is the...
-
Determine whether each of the figures in Problems 30-37 will be a solution to an Instant Insanity puzzle. +++
-
What is the expectation for the \(\$ 1\) bets in Problems 21-30 on a U.S. roulette wheel? See Figure 13.8 Column bet 4 16 33 1 20 14 31 9 22 18 29 28 12 35 3 26 0 32 15 19 4 21 2 25: 4 21 2 25 17 34...
-
Poker is a common game in which players are dealt five cards from a deck of cards. We found there are 2,598,960 different possible poker hands. The winning hands (from highest to lowest) are shown in...
-
1.Macroeconomics, as opposed to microeconomics, includes thestudy of what determines the level of A. employment in a specific industry B.employment in the economy C.output of a specific firm D.output...
-
Problem 3.5 (4 points). We will prove, in steps, that rank (L) = rank(LT) for any LE Rnxm (a) Prove that rank (L) = rank (LTL). (Hint: use Problem 3.4.) (b) Use part (a) to deduce that that rank(L) =...
-
Walter, a single taxpayer, purchased a limited partnership interest in a tax shelter in 1985. He also acquired a rental house in 2012, which he actively manages. During 2012, Walter's share of the...
-
Matthew borrows $250,000 to invest in bonds. During 2012, his interest on the loan is $30,000. Matthew's interest income from the bonds is $10,000. This is Matthew's only investment income. a....
-
In 2012, Michael has net short-term capital losses of $2,000, a net long-term capital loss of $45,000, and other ordinary taxable income of $45,000. a. Calculate the amount of Michael's deduction for...
-
Some people argue that the government should not intervene in the case of a market failure because the government itself is inefficient and will simply create new problems to replace the ones it is...
-
Consider each of the following issues and discuss whether you support Theory X, Theory Y, neither theory, or some combination of them. Issue Theory X Theory Y Whether a person is healthy or sick...
-
Looking at Medicaids traditional eligibility rules, you will notice numerous value/policy judgmentspregnant women and children are favored over childless adults, the medically needy are favored over...
Study smarter with the SolutionInn App