Database Reference
In-Depth Information
14.4 Querying the System Catalog
The system catalog can be queried using SQL Select statements in a manner similar to
any created relational table. This is one of the many remarkable features of the relational
DBMS, and a powerful witness to the potency of Date's Zero Rule (see Chapter 9).
Example 1: What columns does the table Student have?
Example 2: What relation(s) contain(s) the attribute Pgm#?
Example 3: What relation(s) contain(s) an attribute that is CHAR(7)?
Example 4: The catalog may be used to keep track of certain related tables, defined
for a particular system. For instance, if the tables of interest are prefixed 'CMP' then the
following statement will yield a list of tables of interest:
Example 5: List all logical views in the system, and all valid users:
14.5 Updating the System Catalog
Direct update (via INSERT, UPDATE, DELETE) of system catalog record, is not allowed as
this would be an avenue for compromising the integrity of the database.
The system catalog is automatically updated by the system DBMS when statement
such as CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE VIEW, DROP VIEW,
CRETE INDEX, DROP INDEX, CREATE SYNONYM, DROP SYNONYM, etc. are issued.
In short, whenever a database object is created or modified, the system catalog is
automatically updated by the DBMS.
 
Search WWH ::




Custom Search