Relational Data Model
Relational Data Model
The relational data model provides conceptual tools to design the database
schema of the relational database. The relational model describes the data,
relationship between that data, data sematic and constraints on the data in the
relational database. The relational model expresses the data and relationship among
the data in the form of tables.
Relational Data Model was first prosed by Ted Codd of IBM in the 1970s. But, its
commercial implementations were observed in the 1980s. The relational data model
is employed for storing and processing the data in the database.
The building blocks of the relational model has been developed on the concept
of mathematical relation. And its theoretical concepts are based on set
theory and first-order predicate logic. The relational model is also referred to as
the record-based model as it frames the database in fixed-format records of
various types.
A relational model is popular for its simplicity and possibility of hiding the low-level
implementation details from database developer and database users.
It is a Student relation and it is having entries of 5 students (tuples) in it. The figure
below will help you identify the relation, attributes, tuples and field in a relational model.
4. Each tuple must have exactly one data value for an attribute. For example,
below in the first table, you can see that for Roll_No. 265 we have enrolled two
students Jhoson and Charles, this would not work. We must have only one
student for one Roll_No.
Domain Constraints
• Each attribute in a tuple is declared to be of a particular domain (for example,
integer, character, Boolean, String, etc.) which specifies a constraint on the
values that an attribute can take.
• Domain constraints specify that within each tuple, and the value of each
attribute must be unique. This is specified as data types which include
standard data types integers, real numbers, characters, Booleans, variable
length strings, etc.
Example:
In the given table, CustomerID is a key attribute of Customer Table. It is most likely to
have a single key for one customer, CustomerID =1 is only for the CustomerName ="
Google".
• The set of attributes that form foreign key of relation R1 should have the same
domain as the primary key of the referenced relation R2.
• In the current state, the set of values of the foreign key in tuple t1 of relation
R1 must match a primary key value in referenced relation R2 or it could
be NULL.
Whenever one of these operations are applied, integrity constraints specified on the
relational database schema must never be violated.
Insert Operation
The insert operation gives values of the attribute for a new tuple which should be
inserted into a relation.
You can see that in the below-given relation table CustomerName= 'Apple' is updated
from Inactive to Active.
Delete Operation
To specify deletion, a condition on the attributes of the relation selects the tuple to be
deleted.
The Delete operation could violate referential integrity if the tuple which is deleted is
referenced by foreign keys from other tuples in the same database.
Select Operation
• Simplicity: A relational data model is simpler than the hierarchical and network
model.
• Structural Independence: The relational database is only concerned with data
and not with a structure. This can improve the performance of the model.
• Easy to use: The relational model is easy as tables consisting of rows and
columns is quite natural and simple to understand
• Query capability: It makes possible for a high-level query language like SQL
to avoid complex database navigation.
• Data independence: The structure of a database can be changed without
having to change any application.
• Scalable: Regarding a number of records, or rows, and the number of fields, a
database should be enlarged to enhance its usability.
• It hides the physical storage details from the database developers and
database users
• Few relational databases have limits on field lengths which can't be exceeded.
• Relational databases can sometimes become complex as the amount of data
grows, and the relations between pieces of data become more complicated.
• Complex relational database systems may lead to isolated databases where
the information cannot be shared from one system to another.
Summary