The Reporting and Analysis Department has a database containing tables that hold summarized data to make report generati

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

The Reporting and Analysis Department has a database containing tables that hold summarized data to make report generati

Post by answerhappygod »

The Reporting and Analysis Department has a database containingtables that hold summarized data to make report generation simplerand more efficient. They want to schedule some jobs to run nightlyto update summary tables. Create two procedures to update thefollowing tables (assuming that existing data in the tables isdeleted before these procedures run):
BB_PROD_SALES
The Reporting And Analysis Department Has A Database Containing Tables That Hold Summarized Data To Make Report Generati 1
The Reporting And Analysis Department Has A Database Containing Tables That Hold Summarized Data To Make Report Generati 1 (6.7 KiB) Viewed 23 times
BB_SHOP_SALES
The Reporting And Analysis Department Has A Database Containing Tables That Hold Summarized Data To Make Report Generati 2
The Reporting And Analysis Department Has A Database Containing Tables That Hold Summarized Data To Make Report Generati 2 (3.75 KiB) Viewed 23 times
▼ I got an answer to this question
CREATE OR REPLACE PROCEDURE PROD_SALES_SUM_SP (productID INNUMBER, num_month IN CHAR,in_year IN CHAR,total_qty INNUMBER,prod_total IN NUMBER) ASprodCount number;BEGIN SELECT COUNT(*) INTO prodCount FROM BB_PROD_SALES WHERE idproduct = productID AND MONTH = num_month AND YEAR = in_year;IF prodCount = 0 THENINSERT INTO BB_PROD_SALES (idproduct, month, year, qty, total)VALUES (productID, num_month, in_year, total_qty,prod_total);DBMS_OUTPUT.PUT_LINE('Sales details inserted successfully');ELSEUPDATE BB_PROD_SALES SET qty = total_qty, total= prod_totalWHERE idproduct = productID AND MONTH = num_month AND YEAR =in_year;DBMS_OUTPUT.PUT_LINE('Sales details inserted successfully');END IF;END;
Can I just get screenshots of thisquestion?
COLUMN_NAME 1 IDPRODUCT 2 MONTH 3 YEAR 4 QTY 5 TOTAL DATA TYPE NUMBER (2,0) Yes CHAR (3 BYTE) Yes CHAR (4 BYTE) Yes NUMBER (5,0) Yes NUMBER (6,2) Yes NULLABLE DATA_DEFAULT (null) (null) (null) (null) (null) COLUMN_ID COMMENTS 1 (null) 2 (null) 3 (null) 4 (null) 5 (null)
COLUMN_NAME 1 IDSHOPPER 2 TOTAL DATA_TYPE NULLABLE DATA_DEFAULT NUMBER (4,0) Yes (null) NUMBER (6,2) Yes (null) COLUMN_ID COMMENTS 1 (null) 2 (null)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply