Populate the sales_facts table

Assignment Help PL-SQL Programming
Reference no: EM131119828

Using PL/SQL populate the SALES_FACTS table. One way to do this is to use four nested cursor loops to get every possible combination of the dimension tables' primary keys and then the total vehicles sold and gross sales amount for each combination. If these values for Total_Vehicles_Sold and Gross_Sales_Amount for a combination are zero then don't INSERT a row into the SALES_FACT table. Only insert rows for combinations of the four foreign key columns where there were some vehicles sold. Another approach besides nested cursor loops is to use a single INSERT statement with a GROUP BY clause. After populating your SALES_FACTS table execute the query "SELECT COUNT(*) FROM sales_facts;" to show the row count. Also execute the query "SELECT SUM(vehicles_sold) FROM sales_facts;" to ensure that you have included all of your 200 or more sales.

The attached screenshot shows the tables I am trying to get the data from and the table I need to populate (sales_fact) on the left side, and the PL/SQl statement I tried to use and the error it gives me on the right side.

Attachment:- Screenshot.rar

Reference no: EM131119828

Questions Cloud

Explain how each element of the marketing mix is utilized : Explain how each element of the marketing mix (product, place, price, and promotion) is utilized to influence the demand for the company's products or services.
Composition of metals for electronic scrap : Use www.piktochart.com to create an infographic on electronic waste. Create a free account and use a free template (one not labeled "pro") to create your infographic. When you are done, click Download on the upper right-hand side of the screen. Ch..
Why do these two firms have such dramatically different mark : Dataquest, a leading software developer, has a copyright on the best-selling database management program. Why do these two firms have such dramatically different market-to-book ratios?
What role does ethics play in conscious capitalism : Applying conscious capitalism principles typically starts with a plan from the CEO and requires the plan to be implemented through various management levels and all employees. What role does ethics play in conscious capitalism and how do the ethic..
Populate the sales_facts table : Using PL/SQL populate the SALES_FACTS table. One way to do this is to use four nested cursor loops to get every possible combination of the dimension tables' primary keys and then the total vehicles sold and gross sales amount for each combinatio..
Lighting style to camera movements : Write a three page paper analyzing a following scene of your choice, using at least four terms (please bold) you've learned from lecture. You can talk about anything from color choices to lighting style to camera movements.
Describe the extent of police corruption : Describe the extent of police corruption, misconduct, and brutality in the United States - Research two current cases within the last 10 years: one case on police corruption and misconduct and one case on police brutality.
Cross-functional integrated enterprise systems in business : Discussion: Be thorough when discussing the following questions about e-business and entrepreneurial functions.
Modes of communication in the organization : In this assignment you will analyze the organizational behavior of your current or former employer. Describe how the following areas influence the organizational behavior in a negative or positive manner:

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Correlated sub-query to return one row per customer

Use a correlated sub-query to return one row per customer, representing the customer's oldest order (the one with the earliest date).

  Write a perl subroutine for temperature conversion

Write a perl subroutine for temperature conversion named ' convert_temp '. It should be able to handle both Fahrenheit to Celsius conversions as well as Celsius to Fahrenheit conversions.

  How to select the primary key

How to select the primary key from the candidate keys? How do foreign keys relate to candidate keys? provide examples from either your workplace or class assignments

  Write a query to display the starting salary

Write a query to display the starting salary for each employee. The starting salary would be the entry in the salary history with the oldest salary start date for each employee. Sort the output by employee number.

  The database design

Update the TOC to reflect the new section.Name the document CS251_ _Final.doc.Submit the document for grading.Submit your database file to the Submission Area.

  Find the sum of the elements of a

A is an ArrayList of size N. The elements of A are integers, they are in sorted order increasing from the low end of the array, and no two integers are the same. Variable x is an integer. Which of the following operations takes time that is less t..

  Write a statement to create a view that selects all fields

Write a statement to add a check constraint to the above defined table, which guarantees that values entered in the Class field can only be limited to the following strings: Open, Spec, and Priv.

  Find the most classes taken by students

Find the students by student ID who have taken the most class (counted by enrolled students) and not counting where an ‘F' was the grade - Find the facility by facility id who teach math class.

  Question 1write a perl subroutine for temperature

question 1write a perl subroutine for temperature conversion named converttemp. it should be able to handle both

  Develop a pl/sql user-defined function

Develop a PL/SQL user-defined function ZIP_CODE_SALES_WINNER that returns the zip code with the largest total car purchases. Since there can be a tie with two or more zip codes, ensure that the lowest numeric zip code is returned.

  Provide sql statements to create the database

Provide SQL statements to create the database and populate it with sample data (at least four rows per table).

  Describe conceptually how an sql retrieval query

Question 1: Describe conceptually how an SQL retrieval query will be executed by specifying the conceptual order of executing each of the six clauses?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd