Question

In: Computer Science

Create following table. CREATE TABLE Registration (Reg_ID number(5), Name Varchar2(20), Address Varchar2(20), create_date date, created_by varchar2(10)...

Create following table.

CREATE TABLE Registration

(Reg_ID number(5),

Name Varchar2(20),

Address Varchar2(20),

create_date date,

created_by varchar2(10)

);

Create an audit trial report on Employee table for all insert, update and delete operations on given table. You have to create audit table first with Current Date, Operation and User to record the information.

Solutions

Expert Solution

Answer :

To setup the audit table, we need to create a trigger for all of these operations in the main table. This is done by following.

Trigger for Inser operation.

create trigger employeeTriggerAuditRecord on Employee
after insert
as
begin
insert into EmployeeAudit
(CurrentDate, Operation, User) select i.created_date, "INSERTED", i.created_by from Employee e
inner join INSERTED i where e.REG_Id = i.REG_Id
end
go

Similarly for Delete operation.

create trigger employeeTriggerAuditRecord on Employee
after update
as
begin
insert into EmployeeAudit
(CurrentDate, Operation, User) select i.created_date, "UPDATED", i.created_by from Employee e
inner join INSERTED i where e.REG_Id = i.REG_Id
end
go

and Delete

create trigger employeeTriggerAuditRecord on Employee
after DELETE
as
begin
insert into EmployeeAudit
(CurrentDate, Operation, User) select i.created_date, "DELETE", i.created_by from Employee e
inner join DELETED i where e.REG_Id = i.REG_Id
end
go

NOTE : PLEASE GIVE ME UP VOTE .THANK YOU.


Related Solutions

Create a table ‘StudentInfo’ with following fields: ID First Name Last Name SSN Date of Birth...
Create a table ‘StudentInfo’ with following fields: ID First Name Last Name SSN Date of Birth Create a table ‘ClassInfo’ table: ID Class Name Class Description Create a table ‘RegisteredClasses’ table: StudentID ClassID The RegisteredClasses table should have a foreign key relationship to StudentInfo and ClassInfo tables for the respective IDs. Also the IDs in StudentInfo and ClassInfo need to be primary keys. When you submit the file your email should also contain the following SQL Queries: Query to show...
Create a student class that stores name, registration number and percentage, grade. Add member functions -...
Create a student class that stores name, registration number and percentage, grade. Add member functions - Read( string n, int r, float p): Read function that accepts parameter - Display(): To display student’s information - CalculateGrade()
-- Creating table ProjDept: create table ProjDept ( ProjDeptID NUMBER(10) primary key, ProjDeptName varchar2(20), OfficeLocation varchar2(20),...
-- Creating table ProjDept: create table ProjDept ( ProjDeptID NUMBER(10) primary key, ProjDeptName varchar2(20), OfficeLocation varchar2(20), PhoneNumber varchar2(20) ); INSERT INTO ProjDept (ProjDeptID, ProjDeptName, OfficeLocation, PhoneNumber) VALUES (1001, 'Accounting','ITCC01-400','888-285-8100'); (2001, 'Human Resources','ITCC01-200','888-285-8100'); (3001, 'Marketing','ITCC02-300','888-285-8100'); (4001, 'Information Techn','ITCC02-100','888-285-8100'); (5001, 'Legal','ITCC01-100','888-285-8100'); -- Creating table Employee: create table Employee( EmployeeID NUMBER(10) primary key, FirstName varchar2(20), LastName varchar2(20), ProjDeptID NUMBER(10), PhoneNumber varchar2(20) ); INSERT INTO Employee (EmployeeID, FirstName, LastName, ProjDeptID, PhoneNumber, Email) VALUES (10, 'Mark','Columbus',1001, '888-285-8101', '[email protected]'); (29, 'Elvin','Wahl', 2001, '888-285-8201', '[email protected]'); (38, 'Taylor','Noel',...
Please Use JavaScript and HTML 5) Number guesser (easier) Create a number guessing name, using an...
Please Use JavaScript and HTML 5) Number guesser (easier) Create a number guessing name, using an input and a button to gather a number. The number to be guessed should be a hard-coded whole number between 1 and 20. Tell the user if the number is too high, equal to, or too low than a number you have hard-coded in your application. Remove the text in the input when the user clicks the button.
Create a class called Student. Include the following instance variables: name, address, phone, gpa Create all...
Create a class called Student. Include the following instance variables: name, address, phone, gpa Create all of the methods required for a standard user defined class: constructors, accessors, mutators, toString, equals Create the client for testing the Student class Create another class called CourseSection Include instance variables for: course name, days and times course meets (String), description of course, student a, student b, student c (all of type Student) Create all of the methods required for a standard user defined...
Create a new file name condition_quiz.py. Add a comment with your name and the date. Prompt...
Create a new file name condition_quiz.py. Add a comment with your name and the date. Prompt the user to enter the cost. Convert the input to a float. Prompt the user for a status. Convert the status to an integer Compute the special_fee based on the status. If the status is 0, the special_fee will be 0.03 of the cost. Else if the status is 1, the special_fee will be 0.04 of the cost. Else if the status is 2,...
python Create a new file name condition_quiz.py. Add a comment with your name and the date....
python Create a new file name condition_quiz.py. Add a comment with your name and the date. Prompt the user to enter the cost. Convert the input to a float. Prompt the user for a status. Convert the status to an integer Compute the special_fee based on the status. If the status is 0, the special_fee will be 0.03 of the cost. Else if the status is 1, the special_fee will be 0.04 of the cost. Else if the status is...
Create a table with name “S_YOURStudentID” with the following fields with required constraints. Screenshots are to...
Create a table with name “S_YOURStudentID” with the following fields with required constraints. Screenshots are to be attached.                                                                                               For example, if your botho student id is 1212121, your table name should be “S_1212121”.                                   Student id Student Name Age Gender City Course name Module Name Internal mark 1 Internal mark 2 Internal mark 3 Total internal mark Insert minimum 10 records/rows to the table. Input the data based on Question 5. Screenshots are to be attached.                                                                                                                              Create two users...
Create and test an HTML document for yourself, including your name, address, and electronic mail address....
Create and test an HTML document for yourself, including your name, address, and electronic mail address. If you are a student, you must include your major and your grade level. If you work, you must include your employer, your employer’s address, and your job title. This document must use several headings and <em>, <strong>, <hr />, <p>, and <br /> tags. 2.2 Add pictures of yourself and at least one other image (of your friend, spouse, or pet) 2.3 Add...
########################################################### # Lab 5 - Debugging # Name: # Date: # # Objective: # The purpose...
########################################################### # Lab 5 - Debugging # Name: # Date: # # Objective: # The purpose of this lab assignment is to help you understand # debugging processes in assembly language using debug tools # provided by QtSpim # # Description: # 1) Syntax, logic, and comment errors exist in: # - main # - print_array # - read_array # - allocate_array # 2) Find and fix the syntax, logical, and comment errors # *** Hint: Find all the "#To...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT