Remember that you query a view for the information it represents. You can also apply standard SELECT
statements to the view. In other words, when you select from the view, you can further refine the results you retrieve. For example, if you wanted to query the MyView view but only return the rows with a Lastname starting with "W," you could do so with the following statement:
The structure of a relational database is stored in the data dictionary of the database. The
data dictionary is made up of a set of relations that are identical in properties to the relations used to hold data. They can be queried using the same tools used to query data-handling relations. No user can modify the data dictionary tables directly. However, (DML) data manipulation language commands that create, modify, and destroy database structural elements work by modifying rows in
data dictionary tables.
You will typically find the following types of information in a data dictionary:
- Definitions of the columns that make up each table
- Integrity constraints placed on relations
- Security information (which user has the right to perform which operation on which table)
- Definitions of other database structure elements, such as views and user-defined domains
When a user attempts to access data in any way, a relational DBMS first goes to the data dictionary to determine whether the database
elements the user has requested are actually part of the schema.
In addition, the DBMS verifies that the user has the access right to whatever he or she is requesting.
When a user attempts to modify data, the database management system goes to the data dictionary to look for
integrity constraints that may have been placed on the relation. If the data meet the constraints, then the modification is permitted. Otherwise the DBMS returns an error message and does not make the change.
Because all access to a relational database is through the
data dictionary, relational database management systems are said to be data dictionary driven. The data in the data dictionary are known as metadata, which is data about the data.
In the next lesson, you will get the details about how you create and reuse queries.