Using plsql populate the salesfacts table one way to do


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

Solution Preview :

Prepared by a verified Expert
PL-SQL Programming: Using plsql populate the salesfacts table one way to do
Reference No:- TGS01497780

Now Priced at $40 (50% Discount)

Recommended (98%)

Rated (4.3/5)