| Lesson 4 | Characteristics of Database Tables |
| Objective | Describe the characteristics of relational tables and how they map to implementation in an RDBMS. |
Mouse over the highlighted terms below for definitions.
A relational database is a collection of tables. Each table has two parts: a heading that defines the table name and column names, and a body that holds the rows of data. Columns store attributes - the properties of the entity the table represents. Rows store records, each of which is an instance of that entity. In relational theory, a row is called a tuple, and the table itself is called a relation.
Understanding the distinction between the relational theory vocabulary - relation, tuple, attribute - and the practical vocabulary - table, row, column - is important because both sets of terms appear in database documentation, textbooks, and RDBMS tools. They refer to the same underlying structures from different perspectives, as discussed in Lesson 3.
During the logical design phase of the DBLC, entities in an ER diagram are represented as relations using relational notation. When the design moves to the implementation phase, the RDBMS creates a physical table corresponding to each relation. The mapping from logical design to physical implementation should be consistent: table names, column names, data types, primary keys, and foreign keys should all carry directly from the relational notation into the CREATE TABLE statement.
A key design principle is integrity by default: constraints should be defined in the database schema so that the RDBMS rejects invalid data at write-time. Relying on application code to enforce data validity after the fact is fragile - a second application accessing the same database may not apply the same rules. Constraints defined in the schema apply universally, regardless of how or where the data is written.
Keys are the mechanism by which rows in a table are identified and linked to rows in other tables. Three types of keys are relevant to table design:
ON DELETE and ON UPDATE rules that match the intended business semantics
(CASCADE, SET NULL, or RESTRICT).
Each column in a table has a data type that constrains the values it can hold. Choosing appropriate data types is part of physical design and has implications for both data integrity and storage efficiency.
DATE or TIMESTAMP columns rather than strings for date and time
values. Storing dates as strings makes range queries fragile and prevents the RDBMS from enforcing
valid date formats.INT, DECIMAL) rather than strings for quantities,
prices, and counts. Numeric types allow arithmetic operations and range comparisons that are not
possible on string representations of numbers.A null value in a relational database represents the absence of a known value - it is not zero, not an empty string, and not a placeholder. Null values require careful handling because comparisons involving null produce a third logical state (unknown) rather than true or false.
Allow null values only in columns where the absence of data is semantically meaningful - for example,
a DateTerminated column for an employee who is still active. For all other columns, enforce
NOT NULL to guarantee that critical data is always present. A common source of data quality
problems is columns left nullable by default when they should always contain a value.
Normalization is the process of organizing a relational schema to minimize data redundancy and eliminate update, delete, and insert anomalies. The standard normal forms provide a systematic approach:
Design to 3NF or BCNF as a default. Denormalize only when there is a measured, documented performance requirement that normalization cannot satisfy - and document the denormalization explicitly so future maintainers understand why the schema departs from the normal form standard.
Not all tables in a relational database are stored on disk. The distinction between base tables and virtual tables is fundamental to understanding how a relational database is organized.
A base table is a physical table persisted on disk. Its rows are stored in the database and occupy storage space. When you execute an INSERT, UPDATE, or DELETE statement, you are modifying the data in a base table. Base tables are the primary source of data in the relational model.
A virtual table, most commonly implemented as a view, is derived at query time. A view stores only its definition - a SELECT statement - and produces its result set by executing that query against the underlying base tables each time the view is referenced. The data displayed by a view is not stored separately; it is computed on demand.
Views serve three important purposes in a well-designed database:
The Computer table illustrates the characteristics described in this lesson. In relational notation:
Computer (Comp_ID, Processor, HardDrive, Monitor, Purchased, Cost)
The table has one relation name (Computer), one primary key (Comp_ID), and five non-key attributes. Each row represents a single computer instance. The following sample data demonstrates the structure:
| Comp_ID | Processor | Hard Drive | Monitor | Purchased | Cost |
|---|---|---|---|---|---|
| 001 | Intel Core Ultra 9 | 2 TB SSD | 27" 4K | 2026-02-01 | 1899.99 |
| 002 | AMD Ryzen 9 AI | 4 TB SSD | 32" 5K | 2026-02-01 | 2899.99 |
Applying the concepts from this lesson to this table:
DATE type, not a string, to support
date range queries and enforce valid date formats.DECIMAL(10,2) to support accurate financial
calculations and prevent rounding errors.Once a table is defined and populated, how it is accessed and maintained affects both performance and data quality over the operational life of the database.
Mouse over each term for its definition:
Test your understanding of relational table characteristics before moving to the next lesson:
Relational Table Characteristics - Quiz