| Lesson 15 | Data Dictionary |
| Objective | Describe the entries that appear in a completed Data Dictionary |
Understanding the Entries in a Completed Data Dictionary
A data dictionary—also known as a catalog in modern SQL standards—is the authoritative reference for all metadata stored inside a relational database.
Every object you create using SQL (schemas, tables, columns, constraints, indexes, views, triggers, procedures, and roles) is automatically recorded in the data dictionary by the RDBMS.
This lesson explains the typical entries you will see in a completed data dictionary and how they help developers, administrators, and applications understand the database.
1. Table-Level Entries
A complete data dictionary begins by documenting each base table in the system.
These entries describe structural and logical information that supports query optimization, constraint enforcement, and schema evolution.
- Table Name — The identifier for the table within its schema.
- Schema — The logical owner or namespace the table belongs to.
- Description / Purpose — A textual explanation of the table’s role.
- Row Count (Estimated/Actual) — Maintained by some RDBMS (e.g., Oracle statistics, PostgreSQL pg_class).
- Storage Characteristics — Tablespace allocation, compression settings, partitioning details (Oracle).
- Relationships — Links to parent and child tables through foreign keys.
2. Column-Level Entries
Column metadata forms the core of the data dictionary.
Modern RDBMS platforms store far more than just a name and data type; they maintain the full set of rules that safeguard data integrity.
- Column Name — The attribute identifier.
- Data Type — INTEGER, VARCHAR2, DATE, TIMESTAMP, NUMERIC, JSON, XML, etc.
- Length / Precision / Scale — Size specifications relevant to the data type.
- Nullable — Indicates whether the column can store NULL values.
- Default Value — A literal, expression, or sequence-generated default.
- Check Constraints — Validation rules (e.g., price > 0).
- Description — An optional narrative entry for clarity.
3. Keys and Constraints
In a completed data dictionary, key and constraint entries document how data integrity is enforced.
This includes dependencies among tables and rules that guarantee consistency.
- Primary Keys — One or more columns uniquely identifying each row.
- Foreign Keys — Columns referencing primary keys in other tables.
- Unique Constraints — Rules preventing duplicate values.
- Check Constraints — Column-level or table-level rules on allowed values.
- Not Null Flags — Required attributes.
Data Analysis for DB Design
4. Index Entries
Index metadata helps administrators understand how the RDBMS accelerates access to data.
Indexes may be automatically or manually created.
- Index Name
- Index Type — B-tree, bitmap, hash, function-based, unique, clustered/nonclustered.
- Indexed Columns
- Index Purpose — e.g., enforce uniqueness, speed up lookups, support joins.
- Tablespace / Storage Parameters (Oracle-specific)
5. Relationships and Cardinality
A completed data dictionary records how tables relate to one another.
This helps designers and tools visualize the database as an interconnected structure.
- Parent–child relationships
- One-to-one
- One-to-many
- Many-to-many (implemented via intersection tables)
6. View Definitions
Views act as virtual tables. A data dictionary stores:
- View Name
- Underlying Query Definition — The SQL text of the view.
- Base Tables Referenced
- Description — Usage or purpose.
- Security Modes — e.g., WITH CHECK OPTION.
7. Stored Procedures, Functions, and Triggers
Modern RDBMS platforms record executable logic inside the data dictionary to support dependency tracking and permission enforcement.
- Procedure or Function Name
- Arguments and Modes — IN, OUT, IN OUT.
- Return Types (functions only)
- Owner
- Source Code / Body (stored internally or in system catalogs)
- Trigger Event — BEFORE/AFTER INSERT, UPDATE, DELETE.
- Trigger Body — PL/SQL, T-SQL, or procedural logic.
8. Security and Permissions
Since every interaction with the database must be authorized, the data dictionary includes:
- Users, Roles, and Privileges
- Object-level Permissions — SELECT, INSERT, UPDATE, DELETE, EXECUTE.
- System Privileges — CREATE TABLE, ALTER USER, CREATE VIEW.
- Auditing Metadata — Optional logs in Oracle Unified Auditing, PostgreSQL catalog tables, etc.
9. Metadata and Administrative Information
Administrative metadata helps document the entire lifecycle of each object.
- Owner
- Date Created
- Last Modified
- Statistics — Updated via
DBMS_STATS (Oracle) or ANALYZE (PostgreSQL).
- Versioning Notes
- General Documentation and Glossary
10. Why the Data Dictionary Matters
The data dictionary is the backbone of the database.
Without it, the RDBMS cannot validate permissions, enforce constraints, reference dependencies, or return metadata-driven results.
When a user issues a SQL statement, the database engine consults the data dictionary to:
- Verify object existence
- Check user permissions
- Validate foreign key and check constraints
- Locate storage structures
- Resolve names and synonyms
In the next lesson, we explore the actual catalog tables that make up the data dictionary for your RDBMS.
[1] Data Dictionary: The structured metadata catalog that describes every database object, its attributes, and its relationships.
