Question: 4) Using PL/SQL stored procedure populate the SALES_FACTS table. One way to do this is to use four nested cursor loops to get every possible

4) Using PL/SQL stored procedure 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 2 Total_Vehicles_Sold and Gross_Sales_Amount for a combination are zero then dont 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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!