How to use the relational model to do database design? by Eduardo Bellani

On a recent exchange I was asked the following:

… what you mean that you use the relation model to design? …

Let’s first start with the motivation: Why should one use the relational model(RM) to do database design? Here is my one line answer:

It makes it possible to have and to maintain the integrity of your business rules.

To illustrate this point, here are some examples of problems that one faces when one does not have such integrity:

Now to the point at hand: How would one use the relational model to design a database? Let me start by a definition of what is the relational model:

  1. An open-ended collection of scalar types, including type BOOLEAN in particular
  2. A type generator and an intended interpretation for relations of types generated thereby
  3. Facilities for defining variables of such generated relation types
  4. A assignment operator for assigning values to such variables
  5. A complete (but otherwise open-ended) collection of generic operators for deriving values from other values

(Date 2015)

Let’s define a database:

A database is a set of predicates and instatiations of such as propositions. The RM uses relation types to represent predicates. SQL uses table definitions. The RM uses relations to represent the arguments of a predicate, SQL uses rows.

In short, the RM set global constraints on any database design. Here is a (probably incomplete) list with ways that the RM drives database design:

Figure 1: Communist firing squad aiming at the Monument of the Sacred Heart on the Cerro de los Angeles, Spain. 31 August 1936

Figure 1: Communist firing squad aiming at the Monument of the Sacred Heart on the Cerro de los Angeles, Spain. 31 August 1936

References

Date, Chris. 2015. Sql and relational theory: How to write accurate sql code. Paperback. O’Reilly Media.

Links to this note