You are on page 1of 24

RDBMS

(Relational DataBase Management Systems)

TOPICS
• Definition
• Features of RDBMS
• Constraints
• Principles of RDBMS
• RDBMS Operators
• Keys
• Index in RDBMS
• Data Abstraction
• RDBMS Extension & Intension
• Data Independence in RDBMS
• View
• E-R Model
• ACID
• Cardinality
• Different Between DBMS and RDBMS
RDBMS DEFINITION

RDBMS stands for Relational DataBase


Management Systems. It is basically a program that
allows us to create, delete, and update a relational
database. Relational Database is a database system that
stores and retrieves data in a tabular format organized
in the form of rows and columns. It is a smaller subset of
DBMS which was designed by E.F Codd in the 1970s.
The major DBMS like SQL, My-SQL, ORACLE are all
based on the principles of relational DBMS.
CONCEPTS
RDBMS stands for relational database
management system. A relational model can be
represented as a table of rows and columns. A
relational database has following major
components:
1. Table
2. Record or Tuple
3. Field or Column name or Attribute
4. Domain
5. Instance
6. Schema
7. Keys
FEATURES OF RDBMS
 Entity Integrity: No two records of the
database table can be completely duplicate.
 Referential Integrity: Only the rows of those
tables can be deleted which are not used by other
tables. Otherwise, it may lead to data
inconsistency.
 User-defined Integrity: Rules defined by the
users based on confidentiality and access.
 Domain integrity: The columns of the database
tables are enclosed within some structured
limits, based on default values, type of data or
ranges.
CONSTRAINTS
 Constraints are the rules enforced on the data
columns of a table. These are used to limit the
type of data that can go into a table. This ensures
the accuracy and reliability of the data in the
database.
 Constraints could be either on a column level or a
table level. The column level constraints are
applied only to one column, whereas the table
level constraints are applied to the whole table.
PRINCIPLES OF RDBMS/INTEGRITY
RULES
Integrity Rules are imperative to a good database
design. Most RDBMS have these rules automatically,
but it is safer to just make sure that the rules are
already applied in the design. There are two types of
integrity mentioned in integrity rules, entity and
reference.
ENTITY INTEGRITY
“It says that no component of a primary key
may be null.”
All entities must be distinguishable. That is, they
must have a unique identification of some kind.
Primary keys perform unique identification
function in a relational database. An identifier
that was wholly null would be a contradiction in
terms. It would be like there was some entity that
did not have any unique identification. That is, it
was not distinguishable from other entities. If two
entities are not distinguishable from each other,
then by definition there are not two entities but
only one.
REFERENTIAL INTEGRITY
“The referential integrity constraint is specified
between two relations and is used to maintain
the consistency among tuples of the two
relations.”
Suppose we wish to ensure that value that appears in
one relation for a given set of attributes also appears
for a certain set of attributes in another. This is
referential integrity.
The referential integrity constraint states that, a tuple
in one relation that refers to another relation must
refer to the existing tuple in that relation. This means
that the referential integrity is a constraint specified
on more than one relation. This ensures that the
consistency is maintained across the relations.
RDBMS OPERATORS
Relational Set Operators uses relational algebra to
manipulate contents in a database. All together there
are basic four different types of operators.

1) UNION( Union combines two different results obtained by a


query into a single result in the form of a table. However, the
results should be similar if union is to be applied on them.
Union removes all duplicates)
2) INTERSECT( The intersection operator gives the common
data values between the two data sets that are intersected. The
two data sets that are intersected should be similar for the
intersection operator to work )
RDBMS OPERATORS
3) DIFFERENCE (The set difference
operators takes the two sets and returns the
values that are in the first set but not the
second set)
4) PRODUCT (An operation used to merge
columns from two relations. Generally, a
cartesian product is never a meaningful
operation when it performs alone. However, it
becomes meaningful when it is followed by
other operations. It is also called Cross Product
or Cross Join)
Keys
KEYS in DBMS is an attribute or set of
attributes which helps you to identify a
row(tuple) in a relation(table). They
allow you to find the relation between
two tables. Keys help you uniquely
identify a row in a table by a
combination of one or more columns in
that table. Key is also helpful for finding
unique record or row from the table.
Database key is also helpful for finding
unique record or row from the table.
Types of Keys
There are mainly seven different types of Keys in DBMS
and each key has it’s different functionality:
• Super Key - A super key is a group of single or
multiple keys which identifies rows in a table.
• Primary Key - is a column or group of columns in a
table that uniquely identify every row in that table.
• Candidate Key - is a set of attributes that uniquely
identify tuples in a table. Candidate Key is a super
key with no repeated attributes.
• Alternate Key - is a column or group of columns in
a table that uniquely identify every row in that table.
• Foreign Key - is a column that creates a
relationship between two tables. The purpose of
Foreign keys is to maintain data integrity and allow
navigation between two different instances of an
entity.
Types of Keys
• Compound Key - has two or more attributes that allow
you to uniquely recognize a specific record. It is possible
that each column may not be unique by itself within the
database.
• Composite Key - is a combination of two or more
columns that uniquely identify rows in a table. The
combination of columns guarantees uniqueness, though
individually uniqueness is not guaranteed. Hence, they are
combined to uniquely identify records in a table.
“The difference between compound and the composite key
is that any part of the compound key can be a foreign key,
but the composite key may or maybe not a part of the foreign
key.”
• Surrogate Key - An artificial key which aims to uniquely
identify each record is called a surrogate key. These kind of
key are unique because they are created when you don't
have any natural primary key.
WHAT IS AN INDEX?
IN RDBMS
An index is a data structure that contains a copy of
a column (or columns, more on that later) from a
database table that is ordered to increase the speed
of database retrieval operations on the original
column in a table. An index also contains a “key” on
each copied row that points to the original row of
data in the column of the table. An index is created
with the expense of additional writes and storage
space.
DATA ABSTRACTION
Database systems are
made-up of complex data
structures. To ease the user
interaction with database,
the developers hide
internal irrelevant details
from users. This process of
hiding irrelevant details
from user is called data
abstraction.
LEVELS OF ABSTRACTION
We have three levels of abstraction:
 Physical level: This is the lowest level of data
abstraction. It describes how data is actually
stored in database. You can get the complex data
structure details at this level.
 Logical level: This is the middle level of 3-level
data abstraction architecture. It describes what
data is stored in database.
 View level: Highest level of data abstraction.
This level describes the user interaction with
database system.
RDBMS EXTENSION & INTENSION
A relational in a relational database has two components, an
extension and an intension.
 Extension
The extension of a given relation is the set of tuples
appearing in that relation at any given instance. The
extension thus varies with time. It changes as tuples are
created, destroyed, and updated.
 Intension
The intension of a given relation is independent of time. It
is the permanent part of the relation. It corresponds to what
is specified in the relational schema. The intension thus
defines all permissible extensions. The intension is a
combination of two things : a structure and a set of integrity
constraints.
DATA INDEPENDENCE OF DBMS
 Data Independence is defined as a property of
DBMS that helps you to change the Database
schema at one level of a database system without
requiring to change the schema at the next
higher level. Data independence helps you to
keep data separated from all programs that make
use of it.
 You can use this stored data for computing and
presentation. In many systems, data
independence is an essential function for
components of the system.
TInYPES OF DATA INDEPENDENCE
DBMS there are two types of data independence
1.Physical data independence
 Logical data independence refers characteristic of being able to change the
conceptual schema without having to change the external schema.
 Logical data independence is used to separate the external level from the
conceptual view.
 If we do any changes in the conceptual view of the data, then the user view of
the data would not be affected.
 Logical data independence occurs at the user interface level.

2.Logical data independence.


 Physical data independence can be defined as the capacity to change the
internal schema without having to change the conceptual schema.
 If we do any changes in the storage size of the database system server, then
the Conceptual structure of the database will not be affected.
 Physical data independence is used to separate conceptual levels from the
internal levels.
 Physical data independence occurs at the logical interface level.
VIEWS
 A view is a virtual table whose contents are defined by
a query. Like a table, a view consists of a set of named
columns and rows of data.
 A view does not exist as a stored set of data values in
a database.
 A view acts as a filter on the underlying tables
referenced in the view.
 The query that defines the view can be from one or
more tables or from other views in the current or other
databases.
 Views are generally used to focus, simplify, and
customize the perception each user has of the database
 Views can be used as security mechanisms by letting
users access data
E-R MODEL
An Entity–relationship model (ER model) describes
the structure of a database with the help of a diagram,
which is known as Entity Relationship Diagram (ER
Diagram). An ER model is a design or blueprint of a
database that can later be implemented as a database.
The main components of E-R model are: entity set and
relationship set.
PROPERTIES IN RDBMS
(ACID)
CARDINALITY IN RDBMS
Cardinality refers to the relationship between two tables.
Relationship can be of four types :
 One to One – A single row of first table associates with single
row of second table. For example, a relationship between person
and passport table is one to one because a person can have only
one passport and a passport can be assigned to only one person.
 One to Many – A single row of first table associates with more
than one rows of second table. For example, relationship between
customer and order table is one to many because a customer can
place many orders but a order can be placed by a single customer
alone.
 Many to One – Many rows of first table associate with a single
row of second table. For example, relationship between student
and university is many to one because a university can have
many students but a student can only study only in single
university at a time.
 Many to Many – Many rows of first table associate with many
rows of second table. For example, relationship between student
and course table is many to many because a student can take
many courses at a time and a course can be assigned to many
students.

You might also like