Unit 2 Lecture1
Unit 2 Lecture1
2
Relational Model Contd.
3
Relational Model Objects
Common Terminologies used in relational model objects are as follows :
-
• Database
• Relation/Table
• Attribute/Field/Column
• Domain
• Record/Row/Tuple
• Degree/Arity
24
Formal Definition - Relation
• A relation (or relation state) r of the relation schema R(A1, A2, … ,
An), also denoted by r(R), is a set of n-tuples r = {t 1, t2, … , tm}.
• Each n-tuple t is an ordered list of n values t =<v1, v2, …,vn>, where
each value vi, 1 ≤ i ≤ n, is an element of dom(Ai) or special NULL
value.
• The ith value in tuple t, which corresponds to the attribute A i, is
referred to as t[Ai] or t.Ai.
25
Characteristics of Relations
• Duplicate tuples must not be present in a relation
• Each tuple must have exactly one data (atomic) value for an attribute
6
Characteristics of Relations
• Each relation in a database must have a distinct or unique name that
would separate it from the other relations in a database.
• A relation must not have two attributes with the same name
27
Characteristics of Relations
• Tuples in a relation do not have to follow a significant order as the
relation is not order-sensitive. Both of these DEPARTMENT relations
are the same.
8
Formal Definition - Attribute
29
Formal Definition - Domain
• A domain is the original set of atomic values used to model data.
• Domain can be specified via data type , format , and set of possible values
from which the data values are drawn
30
Importance of Relation Models
• It is best suitable for managing the structured in the database.
• It represent the database as a collection of relations .
• Each row in the table represent a collection of related data value
( when relation is represented in table) .
• The table name and column names are used to help to interpret the
meaning of values in each row
35