Integrity and Security
Integrity and Security
Integrity constraints ensure that the changes made to the database do not result in a loss of data consistency. Hence, these are the constraints that guard against the accidental damage to the database. This chapter also presents an introduction to triggers which are statements that are executed automatically by the system as a side effect of modification to the database. Triggers are used to ensure some types of integrity. In addition to protecting data against accidental introduction of inconsistency, the data also needs to be protected from unauthorized access and or alteration. This chapter also examines the ways in which the data may be misused or intentionally made inconsistent, and presents security mechanisms to guard against such occurrences. Domain Constraints It is clear now that a domain of possible values must be associated with each attribute of the database. There are a number of standard domain types, such as integer, character, date/time etc. defined in SQL. Declaring an attribute to be of a particular domain acts as a constraint on the values that it can take. Domain constraints are the most elementary form of integrity constraint, as they can be tested easily by the system whenever a new data item is entered into the database.