RelationalDBDesign RelationalDBDesign

Auditing Features  «Prev  Next»

Auditing specific SQL statements - Exercise

Auditing SQL statements

Objective: Audit SQL statements in the COIN database.

Exercise scoring:

The overall exercise is worth 20 points–2 points for each correct statement. When you have finished, submit your answer .

Background and overview

Earlier in this course, you created a COIN database. In this exercise, you will write a SQL script that will allow you to collect audit records for the use of certain SQL statements against the database.

Download files

You can download a correct version of the script for this exercise from the Resources page.


Write a statement to audit each of the following SQL statements:
  1. The CREATE TABLE command against any table
  2. The DROP TABLE command against any table
  3. The TRUNCATE TABLE command against any table
  4. Any SELECT statements by user BID1
  5. Any SELECT statements by user BID2
  6. Any INSERT statements
  7. Any unsuccessful UPDATE TABLE statements
  8. Any successful DELETE TABLE statements
You should also include the statements to turn off the auditing for each of these options.


  1. You will have to issue a separate AUDIT and NOAUDIT command for each SQL statement.
  2. You can use the TABLE keyword to specify auditing of the CREATE TABLE, DROP TABLE, and TRUNCATE TABLE commands.
  3. You can start auditing for multiple users for the same actions with a single statement.

Submitting your exercise

Submit your answer in the text box below.