Vocab. Ch. 4-6 Flashcards
view
An application program’s or an individual user’s picture of the database. An individual can use a view to create reports, charts, and other objects using database data.
CREATE VIEW
The SQL command used to create a view. Example: CREATE VIEW Games AS SELECT ItemNum, Description, OnHand, Price FROM Item WHERE Category='GME'
defining query
The SELECT command that creates the view and indicates what to include in the view.
queries on views
The DBMS will not except a query on a view. Instead, it merges the query with the query that defines the view to form the query that is actually executed.
CREATE VIEW Games (INum, IDesc, OnHd, Price) AS
SELECT ItemNum, Description, OnHand, Price
FROM Item
WHERE Category=’GME’
Creates a view and changes the field names to INum, IDesc, OnHd, Price
row-and-column subset view
A view that consists of a subset of the rows and columns in some individual table.
Advantages of views
1) Provide data independence. The data base can change without the need to change the view, as long as the change is compatible with the requirements of the view.
2) Each user can have their own view.
3) Views should contain only the fields needed by the user, simplifying the interface. In addition, it provides security for the data.
Indexes
The main mechanism for increasing the efficiency with which data is retrieved from the database within relational model systems. They are very much like indexes in a book, indexes typically contain two fields, one contains the attribute and the other contains the number of the record(s) where it can be found.
index key
The field or combination of fields on which the index is built.
index pros & cons
Pros - Makes certain types of retrials more efficient.
Cons - The index takes up space on a storage device.
- The DBMS must update the index whenever corresponding data in the database is updated.
automatic index creation
Access automatically generates an index for each primary key.
CREATE INDEX
The SQL command for creating an index.
single-field index
Also called a single-column index, an index whose key is a single field.
multiple-field index
Also called a multiple-column index, an index whose key is a more than one key field.
DROP INDEX
The SQL command used to drop (delete) and index that is no longer necessary.
security
The prevention of unauthorized access to the database.
security mechanisms
There are two security mechanisms in SQL systems.
1) Views provide a certain amount of security.
2) The GRANT statement is the main mechanism for providing access to a database.
GRANT
The basic idea of the GRANT statement is that different types of privileges can be granted to users and, if necessary, later revoked. The privileges include such things as the right to select, insert, update, and delete table data.
REVOKED
The SQL command used to revoke a users privileges.
Integrity Rules
A relational DBMS must enforce two important integrity rules:
1) entity integrity
2) referential integrity
Entity Integrity
The primary key should never be allowed to have a null value.
Referential Integrity
The rule that if table A contains a foreign key that matches the primary key of table B, the values of this foreign key must match the value of the primary key for some row in table B or be null. (Enforce Referential Integrity)
Casecade Delete Related Records
A check box which ensures that the deletion of a record also deletes any records that relate to it.
Casecade Update Related Fields
A check box which ensures that changes made to the primary key of a record are also made in the related field record.