Below are 2 tables, the first is the part_description table which stores some generic description information for
Question:
Below are 2 tables, the first is the part_description table which stores some generic description information for a part.
The second is a log table that is meant to record everytime the "part_desc" or "part_copy" field is changed and needs to log for a part,
when it was changed, what field was changed and both the original and new value for that field. The log also needs to record when a new record is added,
in which case the "original_value" field will be set to NULL. Please provide SQL statements/code/pseudo code that would be needed to implement a trigger
solution on the part_description table that would log these changes into the part_description_change_log table.
TABLE part_description
part_num varchar,
part_desc text,
part_copy text
PRIMARY KEY (part_num)
TABLE part_description_change_log
part_num varchar,
change_time timestamp,
field_changed varchar,
original_value text,
new_value text
Accounting Information Systems
ISBN: 978-1133935940
10th edition
Authors: Ulric J. Gelinas, Richard B. Dull