Question: USING SQL Write a procedure that automatically insert the paid invoices from invoices table into the paid_invoices table. Inserted Invoices should be unique ( no
USING SQL
Write a procedure that automatically insert the paid invoices from invoices table into the paid_invoices table.
Inserted Invoices should be unique ( no duplicate invoices).
Write a function that check whether or not an invoice exists in paid_invoices.
The "INVOICES" and "PAID_INVOICES" have the same data types.
Only invoices paid in full ( Invoice_total = payment_total + credit_total) should be transferred to "PAID_INVOICES" table

**** EDIT ****
The invoice_id is a number like (33) and the Primary Key
The invoice_number is a varchar2 like ('Qb3295jd')
The same invoice_id can have multiple invoice_numbers
+NULLABLE DATA-DEFAULT )COLUMN-ID COMMENTS COLUMN NAME DATA TYPE NUMBER NUMBER 1 INVOICE ID 2 VENDOR ID 3 INVOICE_NUMBER VARCHAR2 (50 BYTE) No 4 INVOICE DATE 5 INVOICE TOTAL NUMBER (9,2) 6 PAYMENT_TOTAL NUMBER (9,2) 7 CREDIT TOTAL 8 TERMS ID 9 INVOICE DUE DATE DATE (null) (null) (null) (null) (null) 1 (null) 2 (null) 3 (null) 4 (null) 5 (null) 6 (null) 7 (null) 8 (null) 9 (null) 10 (null) No DATE No Yes Yes No No Yes NUMBER (9,2) NUMBER. (null) (null) (null) 10 PAYMENT DATE DATE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
