Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a table with two columns. Name the table First Initial _ Last Name. Using Oracle SQL TABLES THAT I CREATED Table 1 CREATE

1. Create a table with two columns. Name the table First Initial _ Last Name. Using Oracle SQL

TABLES THAT I CREATED

Table 1 CREATE TABLE a_will( Id int NOT NULL PRIMARY KEY, FirstName varchar(50) NULL, LastName varchar(50) NULL );

Table 2 CREATE TABLE a_will_log( EventId varchar(100) NULL, TimeExecuted date NULL, QueryCommand varchar(200) NULL );

Table 3 CREATE TABLE a_will_history( Id int NOT NULL, LogEventId varchar(100) NULL, OldValue varchar(100) NULL, NewValue varchar(100) NULL, ColumnName varchar(100) NULL );

2. You have to audit all DML statements on your table. To do this you write two triggers and provide test cases.

Trigger1. To log any DML statements that users might run on this table. The results must be stored in the First Initial _ Last Name _ Log table

The table should have unique event ID, values for both the Oracle and the system user who ran the query, the time it was executed and the type of DML query user ran.

Trigger2 To capture any data that was changed in the table. The results must be stored in the First Initial _ Last Name _ History table

The table should reference the event ID from the log table, and store both old and new values for both columns.

NEED HELP WITH TRIGGERS AND TEST CASES

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions