Professional Documents
Culture Documents
collection of relations.
When a relation is thought of as a table of values,
each row in the data corresponds to the real world
entity or relationship.
In formal relational model terminology:
A row is called a tuple.
A column header is called an attribute.
The table is called a Relation.
A Domain D is a set of atomic values.
Atomic: the values are indivisible.
A common method of specifying the domain is to
specify a data type from which the data values
forming the domain are drawn.
Example:
India_Mob_Numbers: Set of 10 digit mobile
numbers valid in India.
Name: Set of character strings that represent
names of a person.
Dept names or dept codes.
Domain is also specified in terms of data type and
formats.
Domain for India_Mobile_Numbers can be
declared as data type character string of the form
+dd-dddddddddd.
Dates have various formats such as year, month,
date formatted as yyyy-mm-dd, or as dd mm,yyyy
etc.
The domain is thus given a name, data type and
format.
The Schema (or description) of a Relation:
Denoted by R(A1, A2, .....An)
R is the name of the relation
The attributes of the relation are A1, A2, ..., An
The degree of the relation is the number of
attributes of its relation schema.
Example:
CUSTOMER (Cust-id, Cust-name, Address, Phone#)
CUSTOMER is the relation name
Defined over the four attributes: Cust-id, Cust-
name, Address, Phone#
Each attribute has a domain or a set of valid
values.
For example, the domain of Cust-id is 6 digit
numbers.
Using data types of each attribute, the definition is
sometimes written as:
CUSTOMER( Cust-Id: integer, Cust-Name:
string, Address: string, Phone number: string)
Domains can be specified as:
dom(Cust-id)= Customer_Id
dom(Cust-name)= Customer_Name
dom(Address)= Customer_Address
dom(Phone number)=India_Phone_Number
Table Relation
Row Tuple