Domain Relation Schema and Relation State in RDBMS

For Complete YouTube Video: Click Here

In this class, we will understand the Domain Relation Schema and Relation State in RDBMS.

We have already discussed the basic terminology of RDBMS.

Domain Relation Schema and Relation State in RDBMS

Domain

The domain is the data type describing the type of values that can appear in each column.

To understand this, we will consider the relation obtained in the previous class, as shown below.

Domain Relation Schema and Relation State in RDBMS
Domain Relation Schema and Relation State in RDBMS

The values stored in a ‘relation or table’ should be of a specific data type.

For example, in the above relation, the name is a character data type, age of the employee should be of integer data type, DOB is of date data type, SSN is of integer data type, and salary is of float data type.

The specification of data types allows a set of values to be inserted in the column.

For example, in the age data type, we try to insert ABC, which is not in the domain of integers.

Relation Schema

A Relation Schema R, denoted by R(A1, A2, A3, …., An), comprises a relation name R and a list of attributes.

The degree of a ‘relation’ is the number of attributes.

The employee relation has a degree of 5.

A relation schema is the representation of a relation.

The relation can be represented by R(A1, A2, A3, …., An).

R stands for relation name.

A1, A2, A3, An are the attribute names.

The image below shows the relation schema for the above employee relation.

Domain Relation Schema and Relation State in RDBMS 1
Domain Relation Schema and Relation State in RDBMS 1

Another way of representing the relation schema is as shown below.

Domain Relation Schema and Relation State in RDBMS 2
Domain Relation Schema and Relation State in RDBMS 2

Relation State

A Relation state ‘r’ of a relation schema R(A1, A2, A3, …., An), also denoted by r( R ), is the set of n tuples.

The relation state represents a relation with all the tuples at any particular point in time.

The relation state of the employee relation at that particular point in time, as shown below.

Domain Relation Schema and Relation State in RDBMS
Domain Relation Schema and Relation State in RDBMS