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

  Creating a table named inventory

Create a table named Inventory using the instructions above. Use the data shown below, with the following guidelines:

  If the value for the listprice column is a negative number

If the value for the ListPrice column is a negative number, the stored procedure should raise an error that indicates that this column doesn't accept negative numbers. Similarly, the procedure should raise an error if the value for the DiscountPer..

  Oracle general sql exercise

Oracle General SQL Exercise

  Script that creates and calls a function named

Write a script that creates and calls a function named fnDiscountPrice that calculates the discount price of an item in the OrderItems table (discount amount subtracted from item price). To do that, this function should accept one parameter for th..

  Assignment related to sql programming

Define a one-to-many relationship between the Customer table and Orders table. Right click in the window and select Show table. Select the referential integrity option and both cascade options for the relationships. Save the relationship.

  Consider the relational schema of part of a firm database

consider the relational schema of part of a firm database below. write a sql query for each of the following

  Display all the lastnames from the customers

Display all the LastNames from the Customers table and any associated OrdersIDs from the Orders Table. Show the LastName even if they do not have any associated orders. Order the results by LastName in ascending order.

  Design a working prototype of the proposal

Design a working prototype of the proposal. You will be required to utilize SQLite Database - Provide a brief synopsis analyzing the detailed requirements of your prototype database design.

  Understand the concept of normalization

This assignment has been designed so that you understand the concept of Normalization.

  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..

  Writing and execuinge sql command

The table name will be METALS and will be used to store description of various metals. Following offers some additional direction on how table must be created.

  Describe an algorithm you could use that would output each

Given a list containing Province, CustomerName and SalesValue (sorted by Province and CustomerName), describe an algorithm you could use that would output each CustomerName and SalesValue with the total SalesValue per Province.

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