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

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

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