This module reviews the fundamental concepts and terminology of relational database design. Even if you are an experienced database designer, working through this module will reinforce the vocabulary and conceptual framework used throughout the course. The lessons progress from the relational database model itself through the constraints that govern table structure, data integrity, and the relationships between tables.
After completing the lessons in this module, you should be able to:
The relational database model improves on the restrictions of a hierarchical structure without completely abandoning the concept of data hierarchy. In a purely hierarchical model, retrieving data requires traversing the hierarchy from the top downward - to find a single employee record, a query must first locate the company, then the department, then the employee. The relational model eliminates this constraint: any table can be accessed directly without navigating through parent objects.
Consider a practical example. To find the address of a specific employee, you need only query the employee table directly. You do not need to search the entire organizational hierarchy from the company level downward. If you do not know the specific employee, you can examine all employees in a single table scan. The key is knowing what to look for - and the relational model ensures the data is there to be found.
A second advantage of the relational model is that tables can be linked together regardless of their hierarchical position. A relationship between two tables must exist to justify the link, but the structure of that relationship is not dictated by a rigid parent-child hierarchy. A table can be linked to any number of parent tables and any number of child tables simultaneously. This flexibility is what makes the relational model well-suited to representing the complex, interconnected data structures that real-world business applications require.
Many of today's businesses rely on their database systems for accurate, up-to-date information. Without those repositories of mission-critical data, most businesses are unable to perform their normal daily transactions, much less generate the summary reports that help management make strategic corporate decisions. To be useful, data in a database must be accurate, complete, and organized so that it can be retrieved when needed and in the format desired.
Well-written database application programs - whether they execute locally, run over a local area network, or feed information to a website - are fundamental to timely and accurate data retrieval. However, without a sound underlying database design, even the best application program cannot prevent problems with inaccurate and inconsistent data. The design of the database itself is the foundation on which all application logic depends.
This is why relational constraints matter. They are not optional refinements added after a database is built - they are the structural rules that make a database trustworthy. A database without properly defined constraints is a database that will eventually contain incorrect, incomplete, or contradictory data, regardless of how carefully the application code is written.
Relational constraints are rules enforced by a relational database management system (RDBMS) to ensure data integrity and consistency across tables. These constraints define the conditions that data must satisfy to be considered valid, preventing incorrect or inconsistent data from entering the database in the first place. Rather than relying on application code to enforce data rules, constraints embed those rules directly into the database schema - where they apply universally, regardless of which application or user is inserting or modifying data.
The purpose of relational constraints can be summarized in four areas:
The following constraint types define the functional mechanisms by which relational databases enforce data integrity. Each serves a distinct purpose within the overall constraint framework.
Together these constraints act as a protective framework ensuring that the database adheres to its intended logical structure and business rules at all times. This not only maintains data quality but also supports reliable querying and reporting, as data remains consistent and trustworthy across all related tables regardless of how it was inserted or modified.
The relational database model provides flexible, direct access to data without the traversal overhead of hierarchical structures. Tables can be linked to any number of related tables, and those relationships are governed by relational constraints that enforce integrity at the database level.
Relational constraints - domain, key, entity integrity, referential integrity, NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, and DEFAULT - form the structural foundation of a well-designed database. They are not additions to be configured after the schema is built; they are integral to the schema design itself. A database without appropriately defined constraints cannot guarantee the accuracy or consistency of its data, regardless of the quality of the application code that uses it.
The next lesson reviews the steps in the database life cycle.