What Is RDBMS
What Is RDBMS
All modern database management systems like SQL, MS SQL Server, IBM DB2, ORACLE, My-SQL, and Microsoft
Access are based on RDBMS.
It is called Relational Database Management System (RDBMS) because it is based on the relational model
introduced by E.F. Codd.
How it works
Data is represented in terms of tuples (rows) in RDBMS.
A relational database is the most commonly used database. It contains several tables, and each table has its
primary key.
Due to a collection of an organized set of tables, data can be accessed easily in RDBMS.
Properties of a Relation:
1 Ajeet 24 B.Tech
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA
5 Vimal 26 BSC
What is a row or record?
A row of a table is also called a record or tuple. It contains the specific information of each entry in
the table. It is a horizontal entity in the table. For example, The above table contains 5 records.
Properties of a row:
1 Ajeet 24 B.Tech
What is a column/attribute?
A column is a vertical entity in the table which contains all information associated with a specific
field in a table. For example, "name" is a column in the above table which contains all information about a
student's name.
Properties of an Attribute:
Ajeet
Aryan
Mahesh
Ratan
Vimal
1 Ajeet 24 B.Tech
Degree:
The total number of attributes that comprise a relation is known as the degree of the table.
For example, the student table has 4 attributes, and its degree is 4.
ID Name AGE COURSE
1 Ajeet 24 B.Tech
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA
5 Vimal 26 BSC
Cardinality:
The total number of tuples at any one time in a relation is known as the table's cardinality. The relation whose
cardinality is 0 is called an empty table.
For example, the student table has 5 rows, and its cardinality is 5.
1 Ajeet 24 B.Tech
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA
5 Vimal 26 BSC
Domain:
The domain refers to the possible values each attribute can contain. It can be specified using standard data
types such as integers, floating numbers, etc. For example, An attribute entitled Marital_Status may be limited
to married or unmarried values.
NULL Values
The NULL value of the table specifies that the field has been left blank during record creation. It is different
from the value filled with zero or a field that contains space.
Data Integrity
There are the following categories of data integrity exist with each RDBMS:
Domain integrity: It enforces valid entries for a given column by restricting the type, the format, or the range
of values.
Referential integrity specifies that rows cannot be deleted, which are used by other records.
User-defined integrity: It enforces some specific business rules defined by users. These rules are different
from the entity, domain, or referential integrity.
Relation Table
Let's explain each term one by one in detail with the help of example:
Advertisement
Relation: A relation is usually represented as a table, organized into rows and columns. A relationship consists
of multiple records. For example: student relation which contains tuples and attributes.
Tuple: The rows of a relation that contain the values corresponding to the attributes are called tuples. For
example: in the Student relation there are 5 tuples.
Data Item: The smallest unit of data in the relation is the individual data item. It is stored at the intersection of
rows and columns are also known as cells. For Example: 10112, "Rama" etc are data items in Student
relation.
Domain: It contains a set of atomic values that an attribute can take. It could be accomplish explicitly by
listing all possible values or specifying conditions that all values in that domain must be confirmed. For
example: the domain of gender attributes is a set of data values "M" for male and "F" for female. No database
software fully supports domains typically allowing the users to define very simple data types such as numbers,
dates, characters etc.
Attribute: The smallest unit of data in relational model is an attribute. It contains the name of a column in a
particular table. Each attribute Ai must have a domain, dom(Ai). For example: Stu_No, S_Name, PHONE_NO,
ADDRESS, Gender are the attributes of a student relation. In relational databases a column entry in any row is a
single value that contains exactly one item only.
Cardinality: The total number of rows at a time in a relation is called the cardinality of that relation. For
example: In a student relation, the total number of tuples in this relation is3 so the cardinality of a relation is 3.
The cardinality of a relation changes with time as more and more tuples get added or deleted.
Degree: The degree of association is called the total number of attributes in a relationship. The relation with
one attribute is called unary relation, with two attributes is known a binary relation and with three attributes is
known as ternary relation. For example: in the Student relation, the total number of attributes is 5, so the
degree of the relations is 5. The degree of a relation does not change with time as tuples get added or deleted.
Relational instance: In the relational database system, the relational instance is represented by a finite set of
tuples. Relation instances do not have duplicate tuples.
Relational schema: A relational schema contains the name of the relation and name of all columns or
attributes.
Relational key: In the relational key, each row has one or more attributes. It can identify the row in the
relation uniquely.
Properties of Relations
o Each attribute in a relation has only one data value corresponding to it i.e. they do not contain two or
more values.
o This provides an abstract view of the data. It abstracts the physical structure from the logical
structure of data.
o This model is very easy to design. Tables can use different attributes as per requirements.
o The relational model supports data independence. In a relational database the data is stored in
tables so that we can modify the data without changing the physical structure.
o Relational database helps the user to use a query language to query the database.
o It offers more flexibility than other models.
o By moving sensitive attributes, we can also implement database security control and authorization in
a particular table into a separate relation with its authorization controls.
o Relational database helps the user to use a query language to query the database.
o A relational model consists of simple relationships. The characteristics of a database that make it
immune to certain maintenance problems have been developed in the context of relational models.
o It is useful for representing most real world objects and the relationships between them. It is very
easy to implement a relationship through the use of a composite key, so this model persistence
method dominates the market.
o The main disadvantage of relational models is that they do not support binary data for
example: images, documents, spreadsheets etc.
o The relational model can easily adapt to new hardware so incurs large hardware overhead.
o Relational databases use a simple mapping of logical tables to physical structures.
o This mostly limits performance and allows non-relational systems such as object oriented
management systems to perform better on specialised applications such as CAD, CAM etc.
o Enforcing data integrity in relational models is difficult because no single piece of hardware has
control over the data.
o The relational model is suitable for small databases but not suitable for complex databases because
the user needs to know the complex physical data storage details. So, while designing the databases
they don't come to light when they may cause problems. When a database grows it will slow down
the system and will result in performance degradation and data corruption.
o Insertion Operation
o Deletion Operation
o Update Operation
o Retrieval Operation
Let's explain each operation one by one.
Insert operation: It is used to insert a new record in the table. Adding new records to the table is much easier
than other models. Data values will not be found in a relation when the following condition occurs:
o If we try to insert a duplicate value for the field that is selected as a primary key.
o If we insert a NULL value in the attribute that contains primary key.
o If we try to enter a data value in the foreign key attribute that does not exist in corresponding
primary key attribute.
o If an attribute is assigned a value that does not exist in the corresponding domain.
DELETE operation: This operation is used to delete records from the table but problems arise when the rows
to be deleted have some attributes which are foreign key attributes.
Update operation: It is used to modify or change the data value of a record in a table. Updating an attribute
that is neither a primary key nor a foreign key requires only checking that the new value is of the correct data
type and domain. If we modify a data value of a primary key and foreign key attribute then need to check:
o The modified value does not contain the value of the corresponding foreign key value.
o The new values must not already exist in the table.
Retrieval operation: It is used to save a record from a relation. This operation is very simple and
homogeneous.
The main differences between DBMS and RDBMS are given below:
No. DBMS RDBMS
1) DBMS applications store data as file. RDBMS applications store data in a tabular form.
In DBMS, data is generally stored in either a In RDBMS, the tables have an identifier called primary key
2)
hierarchical form or a navigational form. and the data values are stored in the form of tables.
DBMS has to provide some uniform methods to access RDBMS system supports a tabular structure of the data and a
6)
the stored information. relationship between them to access the stored information.
7) DBMS does not support distributed database. RDBMS supports distributed database.
DBMS is meant to be for small organization and deal RDBMS is designed to handle large amount of data. it
8)
with small data. it supports single user. supports multiple users.
After observing the differences between DBMS and RDBMS, you can say that RDBMS is an extension of DBMS.
There are many software products in the market today who are compatible for both DBMS and RDBMS. Means
today a RDBMS appli cation is DBMS application and vice-versa
Consider an example of a student's file system. The student file will contain information regarding the student
(i.e. roll no, student name, course etc.). Similarly, we have a subject file that contains information about the
subject and the result file which contains the information regarding the result.
Some fields are duplicated in more than one file, which leads to data redundancy. So to overcome this problem,
we need to create a centralized system, i.e. DBMS approach.
DBMS:
A database approach is a well-organized collection of data that are related in a meaningful way which can be
accessed by different users but stored only once in a system. The various operations performed by the DBMS
system are: Insertion, deletion, selection, sorting etc.
In the above figure,
Data Redundancy and Due to the centralization of the In this, the files and application
Inconsistency database, the problems of data programs are created by different
redundancy and inconsistency are programmers so that there exists
a lot of duplication of data which
controlled.
may lead to inconsistency.
Relation Table
Let's explain each term one by one in detail with the help of example:
Relation: A relation is usually represented as a table, organized into rows and columns. A relationship consists
of multiple records. For example: student relation which contains tuples and attributes.
Tuple: The rows of a relation that contain the values corresponding to the attributes are called tuples. For
example: in the Student relation there are 5 tuples.
Data Item: The smallest unit of data in the relation is the individual data item. It is stored at the intersection of
rows and columns are also known as cells. For Example: 10112, "Rama" etc are data items in Student
relation.
Domain: It contains a set of atomic values that an attribute can take. It could be accomplish explicitly by
listing all possible values or specifying conditions that all values in that domain must be confirmed. For
example: the domain of gender attributes is a set of data values "M" for male and "F" for female. No database
software fully supports domains typically allowing the users to define very simple data types such as numbers,
dates, characters etc.
Attribute: The smallest unit of data in relational model is an attribute. It contains the name of a column in a
particular table. Each attribute Ai must have a domain, dom(Ai). For example: Stu_No, S_Name, PHONE_NO,
ADDRESS, Gender are the attributes of a student relation. In relational databases a column entry in any row is a
single value that contains exactly one item only.
Cardinality: The total number of rows at a time in a relation is called the cardinality of that relation. For
example: In a student relation, the total number of tuples in this relation is3 so the cardinality of a relation is 3.
The cardinality of a relation changes with time as more and more tuples get added or deleted.
Degree: The degree of association is called the total number of attributes in a relationship. The relation with
one attribute is called unary relation, with two attributes is known a binary relation and with three attributes is
known as ternary relation. For example: in the Student relation, the total number of attributes is 5, so the
degree of the relations is 5. The degree of a relation does not change with time as tuples get added or deleted.
Relational instance: In the relational database system, the relational instance is represented by a finite set of
tuples. Relation instances do not have duplicate tuples.
Relational schema: A relational schema contains the name of the relation and name of all columns or
attributes.
Relational key: In the relational key, each row has one or more attributes. It can identify the row in the
relation uniquely.
Properties of Relations
o Each attribute in a relation has only one data value corresponding to it i.e. they do not contain two or
more values.
o This provides an abstract view of the data. It abstracts the physical structure from the logical
structure of data.
o This model is very easy to design. Tables can use different attributes as per requirements.
o The relational model supports data independence. In a relational database the data is stored in
tables so that we can modify the data without changing the physical structure.
o Relational database helps the user to use a query language to query the database.
o It offers more flexibility than other models.
o By moving sensitive attributes, we can also implement database security control and authorization in
a particular table into a separate relation with its authorization controls.
o Relational database helps the user to use a query language to query the database.
o A relational model consists of simple relationships. The characteristics of a database that make it
immune to certain maintenance problems have been developed in the context of relational models.
o It is useful for representing most real world objects and the relationships between them. It is very
easy to implement a relationship through the use of a composite key, so this model persistence
method dominates the market.
o The main disadvantage of relational models is that they do not support binary data for
example: images, documents, spreadsheets etc.
o The relational model can easily adapt to new hardware so incurs large hardware overhead.
o Relational databases use a simple mapping of logical tables to physical structures.
o This mostly limits performance and allows non-relational systems such as object oriented
management systems to perform better on specialised applications such as CAD, CAM etc.
o Enforcing data integrity in relational models is difficult because no single piece of hardware has
control over the data.
o The relational model is suitable for small databases but not suitable for complex databases because
the user needs to know the complex physical data storage details. So, while designing the databases
they don't come to light when they may cause problems. When a database grows it will slow down
the system and will result in performance degradation and data corruption.
Operations on Relational Model:
List of the following basic operations that can be performed on a relational model:
o Insertion Operation
o Deletion Operation
o Update Operation
o Retrieval Operation
Let's explain each operation one by one.
Insert operation: It is used to insert a new record in the table. Adding new records to the table is much easier
than other models. Data values will not be found in a relation when the following condition occurs:
o If we try to insert a duplicate value for the field that is selected as a primary key.
o If we insert a NULL value in the attribute that contains primary key.
o If we try to enter a data value in the foreign key attribute that does not exist in corresponding
primary key attribute.
o If an attribute is assigned a value that does not exist in the corresponding domain.
DELETE operation: This operation is used to delete records from the table but problems arise when the rows
to be deleted have some attributes which are foreign key attributes.
Update operation: It is used to modify or change the data value of a record in a table. Updating an attribute
that is neither a primary key nor a foreign key requires only checking that the new value is of the correct data
type and domain. If we modify a data value of a primary key and foreign key attribute then need to check:
o The modified value does not contain the value of the corresponding foreign key value.
o The new values must not already exist in the table.
Retrieval operation: It is used to save a record from a relation. This operation is very simple and
homogeneous.