Need help with SQL homework, questions start under the problems section. This document is intended to relate
Fantastic news! We've Found the answer you've been seeking!
Question:
Need help with SQL homework, questions start under the problems section.
Transcribed Image Text:
This document is intended to relate the concepts we discuss in class to the Oracle SQL Language Reference or to the Oracle PL/SQL Language Reference as applies. In today's class we will (hope to) discuss: 1. Multiple Table Joins (SQL Language Reference: Page 812 - ; See 2075 for NATURAL JOIN & USING) 2. Subqueries (SQL Language Reference: Page 816 - ) a. Set Operators (SQL Language Reference: Page 202) 3. Analytic Functions (SQL Language Reference: Page 295 - ) 4. Hierarchical Queries (SQL Language Reference: Page 803 - ) Problems (Homework 1) 1. Which employees earn more than their department's average earnings? 2. For every product in the product information table, list the number of times it has been sold as well as the employee responsible for selling the largest quantity of it. We want to know if a product has never been sold, so please return all products, regardless of whether they have been sold. 3. Show the hierarchy of employees in the Sales department only. Explicitly show the chain of command using / to depict paths. 4. For each product that has been sold, who is the top salesperson? 5. What is the average salary of all middle-managers? (i.e. folks who manage others but themselves have managers). 6. We want to reward growth. For each month in which a salesperson made sales, determine whether that month's sales are greater than those of the prior month. Generate a column whose values are 'growth' when sales are greater than the prior month and 'no growth' otherwise. 7. Generate a cumulative sum of monthly sales. 8. Do 7 but this time generate the cumulative sum of monthly sales for each salesperson 9. For each month where sales were made give the name or product_description for the for the product sold in the largest quantity. 10. Demonstrate how a hierarchical query can be used to generate the date corresponding the first day of each month in 2022. There should be one column and 12 rows in the result. (do this using the ANSI method, and again using Oracle's CONNECT BY) This document is intended to relate the concepts we discuss in class to the Oracle SQL Language Reference or to the Oracle PL/SQL Language Reference as applies. In today's class we will (hope to) discuss: 1. Multiple Table Joins (SQL Language Reference: Page 812 - ; See 2075 for NATURAL JOIN & USING) 2. Subqueries (SQL Language Reference: Page 816 - ) a. Set Operators (SQL Language Reference: Page 202) 3. Analytic Functions (SQL Language Reference: Page 295 - ) 4. Hierarchical Queries (SQL Language Reference: Page 803 - ) Problems (Homework 1) 1. Which employees earn more than their department's average earnings? 2. For every product in the product information table, list the number of times it has been sold as well as the employee responsible for selling the largest quantity of it. We want to know if a product has never been sold, so please return all products, regardless of whether they have been sold. 3. Show the hierarchy of employees in the Sales department only. Explicitly show the chain of command using / to depict paths. 4. For each product that has been sold, who is the top salesperson? 5. What is the average salary of all middle-managers? (i.e. folks who manage others but themselves have managers). 6. We want to reward growth. For each month in which a salesperson made sales, determine whether that month's sales are greater than those of the prior month. Generate a column whose values are 'growth' when sales are greater than the prior month and 'no growth' otherwise. 7. Generate a cumulative sum of monthly sales. 8. Do 7 but this time generate the cumulative sum of monthly sales for each salesperson 9. For each month where sales were made give the name or product_description for the for the product sold in the largest quantity. 10. Demonstrate how a hierarchical query can be used to generate the date corresponding the first day of each month in 2022. There should be one column and 12 rows in the result. (do this using the ANSI method, and again using Oracle's CONNECT BY)
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Portray in words what transforms you would have to make to your execution to some degree (a) to accomplish this and remark on the benefits and detriments of this thought.You are approached to compose...
-
Asset allocation explains a large portion of a portfolio return. However, the implementation issues involved inthe asset allocation process may reduce the efficiency of the asset allocation strategy,...
-
Describe some of the opportunity costs when you decide to do the following. a. Attend college instead of taking a job b. Watch a movie instead of studying for an exam c. Ride the bus instead of...
-
Similar to the mystery1.html page, create a Web page named resize1.html that contains a dynamic, resizable image. The ONMOUSEOVER attribute of that image should contain JavaScript assignments that...
-
The following facts relative to a variables sampling plan are presented in random order: 1. Combined reliability is 95 percent. 2. Materiality is \(\$ 80,000\). 3. Audited value of sample items is...
-
Amoruso Engine Shop uses a job order cost system to determine the cost of performing engine repair work. Estimated costs and expenses for the coming period are as follows: Engine parts...
-
You are starting a business and as part of your business plan you need to develop a break - even analysis. Your fixed costs ( overhead ) associated with your store are $ 1 , 0 0 0 , 0 0 0 annually,...
-
One month Tom rented 12 movies and 2 video games for a total of $29. The next month he rented 3 movies and 5 video games for a total of $32. Find the rental cost for each movie and each video game. 2...
-
Why is granting credit riskier in an international context?
-
What are some factors that make cash management more complicated in a multinational corporation than in a purely domestic corporation?
-
Are there international differences in firms financial leverage? Explain.
-
Why do Eurobonds appeal to investors?
-
Differentiate between foreign bonds and Eurobonds.
-
Using consequential, rule-based, and character theories, evaluate Juanitas options. What should Juanita do? Why? Juanita Maxwell devotes a great deal of time and energy in getting to know her...
-
An educational researcher devised a wooden toy assembly project to test learning in 6-year-olds. The time in seconds to assemble the project was noted, and the toy was disassembled out of the childs...
-
Derive the mass matrix of each of the systems shown in Figs. 6.20 using the indicated coordinates. R x(1) -21- 31- Rigid bar, mass = 2m A G k F(t) 5m X2(1) F(t) X3(1) F3(1) FIGURE 6.20...
-
For the four-story shear building shown in Fig. 6.35, there is no rotation of the horizontal section at the level of floors. Assuming that the floors are rigid and the total mass is concentrated at...
-
Derive the mass matrix of each of the systems shown in Figs. 6.22 using the indicated coordinates. G3 G5 15 13 k2 04 Mcos wt 01 02 4 kn 12 G G4 16 G6 G Number of teeth on gear G = n, (i = 1 to 6)...
Study smarter with the SolutionInn App