4. Write a Stored Procedure Sales_By_Store that takes (Int) as input and performs the following procedure to create a ne
Posted: Thu Jul 14, 2022 2:17 pm
4. Write a Stored Procedure Sales_By_Store that takes (Int) as input and performs the following procedure to create a new table named Sales_By_Store_Table for the given Store_ID and populate the table with three column info as follow from the three Base tables in the database below. We assume that the new table does not exist in the database. Sales_By_Store_Table : Product_ID (Int) PName (Varchar(30)) SUM(PLineSales) as Sum_PLine_Sales (Int) //for each Product For a given Store_ID from CUSTOMER base table below, the Stored Procedure: Sales_by_Store creates and populates Sales_By_Store_Table that has three columns Product_ID, PName, Sum_PLine_Sales, Where a database has the following three Base tables: PRODUCT PName) PK SALES PLineSales) FK1:Cust ID, FK2: Product ID CUSTOMER (Cust_ID, CustName, Address, PK: