Database System
Relational Model Database
, Relational Model Terminology
• Relationships are represented as tables consisting of rows and columns. Applied only to
logical structures not physical ones.
• An attribute is the name of a column in a table.
• A tuple is a row in a table (record).
• A domain is the set of values of one or more attributes.
• Degree is the number of attributes/columns in the table.
• Cardinality is the number of tuples/rows in the table.
• Relational Database is a collection of normalized relations with clear and distinguishable
relation names.
Alternative Terminology for the Relational Model
In databases, there are several terminologies that actually refer to the same thing. The
difference is due to differences in perspective and differences in application.
Mathematical definition of the relation
• Suppose there are sets D1 & D2 , where D1 = {2, 4} and D2 = {1, 3, 5}.
• The Cartesian product, D1 X D2 , is the set of pairs where the first element is a member of D1
and the second element, a member of D2 .
D1 X D2 = {(2, 1), (2, 3), (2, 5), (4, 1), (4, 3), (4, 5)}
• The subset of the Cartesian product is a relation, for example : R = {(2, 1), (4, 1)}
• It can also be written in pairs with conditions, for example:
▪ second element = 1: R = {(x, y) | x X D1 , y X D2 , and y = 1}
▪ first element = 2 times the second element: S = {(x, y) | x X D1 , y X D2 , and x = 2y}
• If there are 3 sets, D1 , D2 , D3 with Cartesian Product D1 X D2 X D3.
Example :
D1 = {1, 3} D2 = {2, 4} D3 = {5, 6}
D1 X D2 X D3 = {(1,2,5), (1,2,6), (1,4,5), (1,4,6), (3,2,5), (3,2,6), (3,4,5), (3,4,6)}
• The Cartesian product of the set n (D1 , D2 , . . . , Dn ) is :
D1 X D2 X. . .XDn = {(d1 , d2 , . . . , dn ) | d1 Є D1 , d2 Є D2 , . . . . . , dn Є Dn } or can be written:
Relational Model Database
, Relational Model Terminology
• Relationships are represented as tables consisting of rows and columns. Applied only to
logical structures not physical ones.
• An attribute is the name of a column in a table.
• A tuple is a row in a table (record).
• A domain is the set of values of one or more attributes.
• Degree is the number of attributes/columns in the table.
• Cardinality is the number of tuples/rows in the table.
• Relational Database is a collection of normalized relations with clear and distinguishable
relation names.
Alternative Terminology for the Relational Model
In databases, there are several terminologies that actually refer to the same thing. The
difference is due to differences in perspective and differences in application.
Mathematical definition of the relation
• Suppose there are sets D1 & D2 , where D1 = {2, 4} and D2 = {1, 3, 5}.
• The Cartesian product, D1 X D2 , is the set of pairs where the first element is a member of D1
and the second element, a member of D2 .
D1 X D2 = {(2, 1), (2, 3), (2, 5), (4, 1), (4, 3), (4, 5)}
• The subset of the Cartesian product is a relation, for example : R = {(2, 1), (4, 1)}
• It can also be written in pairs with conditions, for example:
▪ second element = 1: R = {(x, y) | x X D1 , y X D2 , and y = 1}
▪ first element = 2 times the second element: S = {(x, y) | x X D1 , y X D2 , and x = 2y}
• If there are 3 sets, D1 , D2 , D3 with Cartesian Product D1 X D2 X D3.
Example :
D1 = {1, 3} D2 = {2, 4} D3 = {5, 6}
D1 X D2 X D3 = {(1,2,5), (1,2,6), (1,4,5), (1,4,6), (3,2,5), (3,2,6), (3,4,5), (3,4,6)}
• The Cartesian product of the set n (D1 , D2 , . . . , Dn ) is :
D1 X D2 X. . .XDn = {(d1 , d2 , . . . , dn ) | d1 Є D1 , d2 Є D2 , . . . . . , dn Є Dn } or can be written: