Difference Between DBMS and RDBMS
Difference Between DBMS and RDBMS
Although DBMS and RDBMS both are used to store information in physical database but
there are some remarkable differences between them.
The main differences between DBMS and RDBMS are given below:
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 application is DBMS
application and vice-versa.
Dr Edgar F. Codd Rules
Dr Edgar F. Codd, after his extensive research on the Relational Model of database
systems, came up with twelve rules of his own, which according to him, a database must
obey in order to be regarded as a true relational database.
These rules can be applied on any database system that manages stored data using only
its relational capabilities. This is a foundation rule, which acts as a base for all the other
rules.
The data stored in a database, may it be user data or metadata, must be a value of some
table cell. Everything in a database must be stored in a table format.
The NULL values in a database must be given a systematic and uniform treatment. This
is a very important rule because a NULL can be interpreted as one the following data is
missing, data is not known, or data is not applicable.
The structure description of the entire database must be stored in an online catalog,
known as data dictionary, which can be accessed by authorized users. Users can use the
same query language to access the catalog which they use to access the database itself.
A database can only be accessed using a language having linear syntax that supports data
definition, data manipulation, and transaction management operations. This language can
be used directly or by means of some application. If the database allows access to data
without any help of this language, then it is considered as a violation.
All the views of a database, which can theoretically be updated, must also be updatable
by the system.
Rule 7: High-Level Insert, Update, and Delete Rule
A database must support high-level insertion, updation, and deletion. This must not be
limited to a single row, that is, it must also support union, intersection and minus
operations to yield sets of data records.
The data stored in a database must be independent of the applications that access the
database. Any change in the physical structure of a database must not have any impact on
how the data is being accessed by external applications.
The logical data in a database must be independent of its users view (application). Any
change in logical data must not affect the applications using it. For example, if two tables
are merged or one is split into two different tables, there should be no impact or change
on the user application. This is one of the most difficult rule to apply.
A database must be independent of the application that uses it. All its integrity constraints
can be independently modified without the need of any change in the application. This
rule makes a database independent of the front-end application and its interface.
The end-user must not be able to see that the data is distributed over various locations.
Users should always get the impression that the data is located at one site only. This rule
has been regarded as the foundation of distributed database systems.
If a system has an interface that provides access to low-level records, then the interface
must not be able to subvert the system and bypass security and integrity constraints.
Normalization in Database (With
Example)
Database normalization is the process of making the data in a database available in the
most organized way possible. It is one of the first concepts you will learn when studying
database management, as you might in a course like SQL Database For Beginners.
When youre normalizing a database, there are two things you need to consider: whether
the information in the database has internal redundancies, and whether the dependencies
across the different tables in the database are logically organized.
The term normalization comes from the concept of normal forms, which describe just
how organized the information is in the database. But normal forms were developed
around the concept of a table-based relational database, which you need to learn about in
order to understand database normalization. You might want to take a course like this one
in RDBMS Concepts to get started. Normal forms are designed to enable the most
straightforward approaches is for searching across information when it is structured in
this manner.
As an example, lets imagine were creating a database of the children in a class, and the
pets they have. When starting to build this database, the first approach might be to create
a simple table with all of the information in one place, and one row for each student.
TABLE: STUDENTS
This works until you realize that Heather might have two pets, a dog and a cat. How
would you represent that in this table? In order to do that, we need to introduce first
normal form.
To achieve first normal form for a database, you need to make sure that no table contains
multiple columns that you could use to get the same information. Each table should be
organized into rows, and each row should have a primary key that distinguishes it as
unique. The primary key is usually a single column, but sometimes more than one
column can be combined to create a single primary key.
Using the rules of first normal form, there may be redundant information across multiple
rows, but each row will be unique.
TABLE: STUDENTS
In this first example there are two rows for Heather, with changes to the second row to
show the fact that there are multiple pets. While this is searchable, and follows first
normal form, it is an inefficient use of space. To achieve second normal form, it would be
helpful to split out the pets into an independent table, and match them up using the
student names as foreign keys.
TABLE: STUDENTS
| Name | Age |
-----------------------------
| Heather | 10 |
-----------------------------
| Rachel | 10 |
-----------------------------
| Jimmy | 11 |
-----------------------------
| Lola | 10 |
-----------------------------
TABLE: PETS
This is a cleaner organization for the information, and avoids repeating the age of the
student with two pets, but the dogs and cats are repeated several times in the pets table.
We can see that it is uncertainty when there are two pets with the same type and the same
name. Is the primary key the owner and the type, the name and the type, or the owner and
the name? Third normal form would suggest making sure each non-key element in each
table provides information about the key in the row.
In order to establish an unambiguous unique identifier for each pet, it is useful to include
a unique primary key that distinguishes each pet from the others. A similar issue could
occur if there were two students with the same name, so creating unique primary key
values for the student table is also a good idea. Often these will be added automatically
when database rows are set to autoincrement. If you need to learn how to do that, you can
take a course to learn Database Design with MySQL, take a course to learn Oracle
database administration, or take a course to learn Microsoft SQL fundamentals and find
out exactly how to autoincrement table rows in the environment you use.
TABLE: STUDENTS
| ID | Name | Age |
----------------------------------
| 00 | Heather | 10 |
----------------------------------
| 01 | Rachel | 10 |
----------------------------------
| 02 | Jimmy | 11 |
----------------------------------
| 03 | Lola | 10 |
----------------------------------
TABLE: PETS
Now it is clear that which pet and which student are associated, the fact that one student
may have more than one pet, or that one pet may be shared among more than one student,
needs to be represented. For this example, imagine that we needed to show that the cat
named Thomas as actually shared between Lola and Heather. To represent this clearly, we
need to add a third table of relationships.
TABLE: STUDENTS
| ID | Name | Age |
----------------------------------
| 00 | Heather | 10 |
----------------------------------
| 01 | Rachel | 10 |
----------------------------------
| 02 | Jimmy | 11 |
----------------------------------
| 03 | Lola | 10 |
----------------------------------
TABLE: PETS
Table: PETS-STUDENTS
| Pet ID | Owner ID |
---------------------
| 00 | 00 |
---------------------
| 01 | 00 |
---------------------
| 02 | 01 |
---------------------
| 03 | 02 |
---------------------
| 01 | 03 |
---------------------
Now we have a flexible and searchable structure in fourth normal form that can represent
all the available information about each of the students, each of the pets, and the
relationships among them. As you learn more about databases, you will come to
recognize the challenges of structuring the data according to your actual needs.
An important thing to keep in mind as you learn to structure your data is that the normal
forms are not set in stone as goals for every database. Each one is a guideline that you
may choose to use as a reference point when considering the best way to organize your
personal database to meet the needs of your business. Sometimes the most performant or
appropriate organization for your database may not be the most logical one from a
normalization standpoint.
It divides larger tables to smaller tables and link them using relationships.
The inventor of the relational model Edgar Codd proposed the theory of normalization
with the introduction of FirstNormal Form and he continued to extend theory with
Second and Third Normal Form. Later he joined with Raymond F. Boyce to develop
the theory of Boyce-Codd Normal Form.
Theory of Normalization is still being developed further. For example there are
discussions even on 6th Normal Form. But in most practical applications
normalization achieves its best in 3rd Normal Form. The evolution of Normalization
theories is illustrated below-
Assume a video library maintains a database of movies rented out. Without any
normalization all information is stored in one table as shown below.
Table 1
1NF Rules
Each table cell should contain single value.
Each record needs to be unique.
A KEY is a value used to uniquely identify a record in a table. A KEY could be a single
column or combination of multiple columns
Note: Columns in a table that are NOT used to uniquely identify a record are called non-
key columns.
In our database , we have two people with the same name Robert Phil but they live at
different places.
Hence we require both Full Name and Address to uniquely identify a record. This is a
composite key.
Rule 1- Be in 1NF
Rule 2- Single Column Primary Key
It is clear that we can't move forward to make our simple database in 2nd Normalization
form unless we partition the table above.
Table 1
Table 2
We have divided our 1NF table into two tables viz. Table 1 and Table2. Table 1 contains
member information. Table 2 contains information on movies rented.
We have introduced a new column called Membership_id which is the primary key for
table 1. Records can be uniquely identified in Table 1 using membership id
You will only be able to insert values into your foreign key that exist in the unique key in
the parent table. This helps in referential integrity.
The above problem can be overcome by declaring membership id from Table2 as
foreign key of membership id from Table1
Now , if somebody tries to insert a value in the membership id field that does not exist in
the parent table , an error will be shown!
A transitive functional dependency is when changing a non-key column , might cause any
of the other non-key columns to change
Consider the table 1. Changing the non-key column Full Name , may change Salutation.
3NF Rules
Rule 1- Be in 2NF
Rule 2- Has no transitive functional dependencies
To move our 2NF table into 3NF we again need to need divide our table.
TABLE 1
Table 2
Table 3
We have again divided our tables and created a new table which stores Salutations.
There are no transitive functional dependencies and hence our table is in 3NF
Now our little example is in a level that cannot further be decomposed to attain higher
forms of normalization. In fact it is already in higher normalization forms. Separate
efforts for moving in to next levels of normalization are normally needed in complex
databases. However we will be discussing about next levels of normalizations in brief in
the following.
Even when a database is in 3rd Normal Form, still there would be anomalies resulted if it
has more than one Candidate Key.
If no database table instance contains two or more, independent and multivalued data
describing the relevant entity , then it is in 4th Normal Form.
A table is in 5th Normal Form only if it is in 4NF and it cannot be decomposed in to any
number of smaller tables without loss of data.
6th Normal Form is not standardized yet however it is being discussed by database experts
for some time. Hopefully we would have clear standardized definition for 6th Normal
Form in near future.
Summary
Database designing is critical to the successful implementation of a database
management system that meets the data requirements of an enterprise system.
Normalization helps produce database systems that are cost effective, cost
effective and have better security models.
Functional dependencies are a very important component of the normalization
process
Most database systems are normalized up to the third normal form.
A primary uniquely identifies are record in a Table and cannot be null