Академический Документы
Профессиональный Документы
Культура Документы
Database Management
Objectives
Discuss
views: what they are, how they are described, and how they are used. Discuss the use of indexes for improving performance. Examine the security features of a DBMS. Explain entity and referential integrity.
Objectives
Discuss
the manner in which the structure of a relational database can be changed. Define the catalog and explain its use. Discuss the integrity support within SQL.
Views
Snapshot
of certain data in the database at a given moment in time Usually much less involved than the full database, offers simplification. Provides measure of security, since sensitive tables or columns can be omitted.
4
4
5
4
6
4
7
Advantages of Views
Provides
data independence. The same data can be viewed by different users in different ways. Contains only those columns required by a given user.
Simplifies the users perception of the DBMS Provides a measure of security by omitting sensitive columns and tables
Indexes
Conceptually
book. Record numbers are automatically assigned and used by the DBMS.
4
10
Figure 4.5
Index for Customer Table on Customer Number Column
4
11
Figure 4.6
Indexes for Customer Table on Credit Limit and Sale Rep Number Columns
4
12
be added or dropped at will. Makes certain types of retrieval more efficient. Occupies space that can be used for something else. The DBMS must update the index whenever corresponding data in the database are updated.
13
4
14
Security
The
prevention of unauthorized access to the database. In SQL, there are two security mechanisms:
GRANT to grant privileges to certain users. REVOKE to later revoke those privileges.
15
Integrity Rules
Entity
integrity is the rule that no column that is part of the primary key may accept null values. Referential integrity states that if table A contains a foreign key that matches the primary key of table B, then values of this foreign key either must match the value of the primary key for the same row in table B or must be null.
16
Figure 4.8
Defining Explicit Relationships Between Tables Using Primary and Foreign Keys
4
17
4
18
Figure 4.10
Referential Integrity Violation Warning When Adding Data
4
19
Figure 4.11
Referential Integrity Violation Warning When Deleting Data
4
20
ALTER
TABLE
DROP
TABLE
21
The Catalog
Information
4
22
4
23
Integrity in SQL
Integrity