Professional Documents
Culture Documents
Lecture11 Database
DatabaseIntegrity
Integrity
1
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
Constraint
The logical restriction on data for the purpose of
maintaining integrity and accuracy of data.
Major type of Database Integrity Constraints are
◦ Domain Constraints
◦ Entity Integrity
◦ Referential Integrity
◦ Action Assertion
2
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
3
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
4
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
5
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
6
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
7
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
8
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
9
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
10
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
FLIGHT-SCHEDULE
Flight_Number Airline Price
101 delta 156
545 american 110
912 scandinavian 450
11
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
Significance of Constraints
By definition a PK is a minimal identifier that is used
to identify tuples uniquely. This means that no subset of
the primary key is sufficient to provide unique
identification of tuples.
12
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
13
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
14
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
15
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
17
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
Significance of Constraints
It plays a vital role in maintaining the correctness,
validity or integrity of the database.
This means that when we have to ensure the proper
enforcement of the referential integrity constraint to
ensure the consistency and correctness of database
18
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
20
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
Referential integrity
constraints are drawn via
arrows from dependent
to parent table
21
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
Deletion Operation
ON DELETE CASCADE:
◦ It indicate that when the row in the parent table is deleted, the
dependent row in the child table is also deleted.
22
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
Deletion Operation
Safety Check :
◦ It does not allow the deletion of the parent table until all
associated records in the child table are deleted.
24
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
Deletion Operation
Null Value :
◦ If the record is deleted from the parents table then the null
value is placed in the foreign key.
25
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
26
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
Example
A person may purchase a ticket for the all-star game
only if that person is a season-ticket holder.
27
Lecture
Lecture11 Database
DatabaseIntegrity
Integrity
28
Lecture 14 Database Security
Database Security
Lec-14
2
Lecture 14 Database Security
3
Lecture 14 Database Security
4
Lecture 14 Database Security
5
Lecture 14 Database Security
6
Lecture 14 Database Security
7
Lecture 14 Database Security
8
Lecture 14 Database Security
Accidental losses
◦ Human error
◦ Software failure
◦ Hardware failure
9
Lecture 14 Database Security
10
Lecture 14 Database Security
Loss of Privacy
Loss of Privacy mean a loss of protection of individuals
data.
11
Lecture 14 Database Security
Loss of Privacy
Loss of confidentiality mean loss of protection of
organizational data that may have strategic value to the
organization.
12
Lecture 14 Database Security
13
Lecture 14 Database Security
Loss of availability
Damage of hardware, networks, or applications may
cause the data to become unavailable to users, which
again may lead to severe operational difficulties.
14
Lecture 14 Database Security
Views or subschemas
Integrity controls
Authorization rules
User-defined procedures
Encryption
Authentication schemes
Backup, journalizing, and checkpointing
15
Lecture 14 Database Security
Views or subschemas
View is virtual relation that does not necessarily exist in
the database but can be produced upon request by a
particular user , at the time of request.
It may dynamically derived from one or more base
relations.
It is always based on the current data in the base tables
from which it is built.
16
Lecture 14 Database Security
Views or subschemas
The view mechanism provides a powerful and flexible
security mechanism by hiding parts of the database from
certain users.
The user is not aware of the existence of any attributes
or row that are missing from the view.
17
Lecture 14 Database Security
Views or subschemas
It effectively prevent the user from viewing other data
that may be private or confidential.
The user may be granted the right to access the view, but
not to access the base tables upon which the view is
based.
18
Lecture 14 Database Security
Integrity controls
Prevents data from becoming invalid, and hence giving
misleading or incorrect results.
Maintaining a secure database system by preventing data
from becoming invalid.
Protect data from unauthorized use
Domains–set allowable values
19
Lecture 14 Database Security
Authorization rules
Authorization rules are controls incorporated in the data
management system that restrict access to data and also
restrict the actions that people may take when they
access data.
A person who can supply a particular password may be
authorized to read any record in a database but cannot
necessarily modify any of those records.
20
Lecture 14 Database Security
Authorization rules
Example
◦ A person who can supply a particular password may be
authorized to read any record in a database but cannot
necessarily modify any of those records.
21
Lecture 14 Database Security
Authorization rules
Authorization Matrix
22
Lecture 15 Database Security
Implementing
authorization
rules
Authorization table for objects (orders)
Oracle privileges
23
Lecture 14 Database Security
Authorization rules
Encryption
It is the coding of data so that humans cannot read them.
Some DBMS products include encryption routines that
automatically encode sensitive data when they are stored
or transmitted over communications channels.
Example
◦ Encryption is commonly used in electronic funds transfer (EFT)
systems.
25
Lecture 14 Database Security
Encryption
Type of encryption
26
Lecture 14 Database Security
Encryption
Type of encryption
One Key Encryption
◦ It is also called data encryption standard (DES), both the sender
and the receiver need to know the key that is used to scramble
the transmitted or stored data.
27
Lecture 14 Database Security
Encryption
Type of encryption
Two Key Encryption
◦ It is also called asymmetric encryption, employs a private and a
public key.
28
Lecture 14 Database Security
Authentication
Positive identification of the user
Identify the user that who are trying to gain access to a
computer or its resources.
29
Lecture 14 Database Security
Authentication
Identify the user that who are trying to gain access by
supplying one of the following factor.
◦ Something the user knows, usually a password or personal
identification number (PIN)
Authentication
Passwords
31
Lecture 14 Database Security
Authentication
Passwords
32
Lecture 14 Database Security
Authentication
Strong Authentication
33
Lecture 14 Database Security
Authentication
Strong Authentication
34
Lecture 14 Database Security
Authentication
Strong Authentication
35
Lecture 14 Database Security
Authentication
Mediated Authentication
36
Lecture 14 Database Security
37