MORE ON THE DEFINITION OF A RELATION
with C. J. Date

 

 

 

From: DSW

To: Editor

Date: 13 Jul 2004

 

 

After having read Mr. Date's paper on Business Rules, I have come to my own definition of a relation:

 

A relation is an unordered set of instantiations of a predicate. The predicate is composed of unordered typed free variables, each tuple is the predicate restated with bounded variables, or propositions.

 

I hope that I have understood this correctly. Any clarifications or comments would be welcome. 

 

 

C. J. Date Responds: Your definitions aren't too bad as far as they go.  But I'd like to add some clarifications (I'm sure you won't be surprised) ...

 

1. A relation is an ordered set of instantiations of a predicate. 

 

OK, but the instantiations are supposed to be ones that evaluate to TRUE. 

 

2. The predicate is composed of unordered typed free variables. 

 

I would say rather that the predicate is a truth-valued function that involves a set of free variables--or (my preferred term) parameters.  The correspondence between those parameters and the corresponding arguments in any given instantiation has to be pinned down somehow.  That pinning down can be done by name (in which case the parameters might be said, loosely, to be "unordered"); or it might be done by ordinal position (ith argument corresponds to ith parameter), in which case the parameters might be said, loosely, to be "ordered."  Either way, however, the parameters are certainly typed. 

 

3. Each tuple is the predicate restated with bound variables, or propositions. 

 

Each tuple in relation r represents an instantiation of the predicate corresponding to relation r.  Each such tuple contains a value (not "a bounded variable"), representing the argument to be substituted for the corresponding parameter in the predicate. 

 

The following example is extracted from my book AN INTRODUCTION TO DATABASE SYSTEMS, 8th Ed.  Consider the following relation EMP: 

 

 +-------------------------------------------------------------+

 ¦ EMP# : EMP# ¦ ENAME : NAME ¦ DEPT# : DEPT# ¦ SALARY : MONEY ¦

 +-------------+--------------+---------------+----------------¦

 ¦ E1          ¦ Lopez        ¦ D1            ¦            40K ¦

 ¦ E2          ¦ Cheng        ¦ D1            ¦            42K ¦

 ¦ E3          ¦ Finzi        ¦ D2            ¦            30K ¦

 ¦ E4          ¦ Saito        ¦ D2            ¦            35K ¦

 +-------------------------------------------------------------+

 

The predicate here looks something like this: 

 

Employee EMP# is named ENAME, works in department DEPT#, and earns salary SALARY

 

(the parameters are EMP#, ENAME, DEPT#, and SALARY, corresponding of course to the four attributes).  And the corresponding true propositions are: 

 

Employee E1 is named Lopez, works in department D1, and earns salary 40K

 

(obtained by substituting the EMP# value E1, the NAME value Lopez, the DEPT# value D1, and the MONEY value 40K for the appropriate parameters);

 

Employee E2 is named Cheng, works in department D1, and earns salary 42K

 

(obtained by substituting the EMP# value E2, the NAME value Cheng, the DEPT# value D1, and the MONEY value 42K for the appropriate parameters); and so on.

 

 

Posted 10/15/04