Learning about the relational model and relational theory has been interesting. Here are some things I’ve learned thus far:
A tuple is an ordered list of values or elements.
The term originated as an abstraction of the sequence: single, double, triple, quadruple, quintuple, sextuple, septuple, octuple, …, n-tuple, …, where the prefixes are taken from the Latin names of the numerals.
|
1 2 |
(1, 2, 5, 4, 8, 9) 6-tuple |
A set, type or domain is a set of all valid input values.
f(x) = 2x + 1
Domain = All real numbers
f(5) = 2(5) + 1 = 11
f(x) = x-1/2
Domain = All values of x > 0
f(9) = (9)^(-1/2) = 3
f(-1) = (-1)^(-1/2) = undefined (Not valid!)
|
1 2 3 4 5 6 |
INTEGER Domain = all integers between -2,147,483,648 and 2,147,483,647 (for a 4-byte int) CHAR Domain = any value from the set {a, b, c, …, x, y, z, …, \, }, ~} (Of course, depending on your character set) |
An attribute is an ordered pair of attribute name and type name (i.e. Attribute-name:Attribute-type; EmployeeID:INTEGER). An attribute value is a specific valid value for the domain of the attribute. This can be either a scalar value or a more complex type.
Given sets S1, S2, …, Sn (not necessarily distinct), R is a relation on these n sets if it is a set of n-tuples each of which has its first element from S1, its second element from S2, and so on (More concisely, R is a subset of the Cartesian product S1 * S2 * … * Sn). (Codd, 1970)
Codd, E. F. (1970).
A Relational Model of Data for Large Shared Data Bank. Communications of the ACM, 13(9), 377-387.