Objectives

Upon completion of this lesson, you will be able to:

  • list the rules for relational modeling
  • define a relational schema

Introduction

The relational model is a widely adopted method for organizing and structuring data in a database. It was first proposed by E.F. Codd in 1970 as a way to standardize databases, and it has been extremely influential in database design and management since. While other database models exist, the relational database remains the dominant database model for most organizations, although NoSQL databases such as MongoDB are often used in certain situations, such as web shopping carts.

Key concepts of the relational model include:

Relations (or Tables): The relational model views data as a collection of relations. Each relation resembles a table of values or a flat file. Each table represents a certain “entity” (e.g., Customers, Orders, Products).

Attributes (or Columns): Each relation is defined by its attributes. Attributes are characteristics of the entity, they define the structure of the table. Each attribute in a table has a specific domain of values.

Tuples (or Rows): A tuple is an ordered set of values. Each value is derived from the corresponding attribute’s domain. In common terms, a tuple in a database table corresponds to a row.

Keys: A key is an attribute or a set of attributes that uniquely identifies a tuple in a relation. A primary key is the main key of the relation, while a foreign key is a primary key from one table that is used in another table.

Schema: The schema of a relation refers to the structure of the table – i.e., the names of the columns and their types.

Integrity Rules: There are certain rules which every relational database should follow: the entity integrity rule (no primary key may be null or may change), the referential integrity rule (if a foreign key exists in a relation, either the foreign key value must match a primary key value in another relation or the foreign key value must be entirely null).

The relational model also proposes standard mathematical languages based on set theory for manipulating data: the relational algebra and the relational calculus, which form the basis of SQL, the most commonly used language for interacting with databases.

This model’s benefits include its simplicity, structural independence (the physical storage of data can be managed separately from the way the data is logically structured), and its powerful query capabilities. However, it’s not always the best fit for every type of data, particularly for hierarchical or graph-based data.

Tutorials

Foundation: Relational Model

In this video tutorial, Khoury Boston’s Prof. Schedlbauer looks at the foundation of relational databases: the relational model.

Relational Schemas and Database Design

In this video tutorial, Khoury Boston’s Prof. Schedlbauer explains how to map a logical data model into a relational schema and from there into table definitions.

Slide Deck: Relational Model

Summary

The relational model revolutionized database design by organizing data into tables (relations) defined by columns (attributes) and rows (tuples), with attributes being characteristics of the table’s entity. Unique identification of tuples is ensured by keys, and the table structure is defined by a schema. To maintain data integrity, the model follows specific rules and uses mathematical languages like relational algebra and calculus, which underpin SQL. Despite the emergence of NoSQL databases, the relational model remains dominant due to its simplicity, structural independence, and strong query capabilities, although it might not suit all data types.


Files & Resources

All Files for Lesson 60.110

References

None.

Errata

None collected yet. Let us know.