What Is Relational Model
What Is Relational Model
What Is Relational Model
The table name and column names are helpful to interpret the meaning of values in each
row. The data are represented as a set of relations. In the relational model, data are
stored as tables. However, the physical storage of the data is independent of the way the
data are logically organized.
There are many types of integrity constraints. Constraints on the Relational database
management system is mostly divided into three main categories are:
1. Domain constraints
2. Key constraints
3. Referential integrity constraints
Domain Constraints
Domain constraints can be violated if an attribute value is not appearing in the
corresponding domain or it is not of the appropriate data type.
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:
Key constraints
An attribute that can uniquely identify a tuple in a relation is called the key of the table.
The value of the attribute for different tuples in the relation has to be unique.
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".
1 Google Active
2 Amazon Active
3 Apple Inactive
Example:
In the above example, we have 2 relations, Customer and Billing.
Whenever one of these operations are applied, integrity constraints specified on the
relational database schema must never be violated.
Inset Operation
The insert operation gives values of the attribute for a new tuple which should be inserted
into a relation.
Update Operation
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
Summary
The Relational database model represents the database as a collection of relations
(tables)
Attribute, Tables, Tuple, Relation Schema, Degree, Cardinality, Column, Relation
instance, are some important components of Relational Model
Relational Integrity constraints are referred to conditions which must be present for
a valid relation
Domain constraints can be violated if an attribute value is not appearing in the
corresponding domain or it is not of the appropriate data type
Insert, Select, Modify and Delete are operations performed in Relational Model
The relational database is only concerned with data and not with a structure which
can improve the performance of the model
Advantages of relational model is simplicity, structural independence, ease of use,
query capability, data independence, scalability.
Few relational databases have limits on field lengths which can't be exceeded.