RELATIONAL DATABASE
MANAGEMENT
SYSTEM
(RDBMS)
Prepared by
Muhammad Ashfaq Najar
⚫File System
⚫Database
File System
⚫A File System is a type of
data store, Which can be used to store,
retrieve and update a set of file.
⚫A File System, data is directly stored in set of files.
It contains flat files that have no relation to other
files.
Disadvantages of File System
⚫ Data Redundancy
⚫ Data Inconsistency
⚫ Difficulty in Accessing
Data
⚫ Data Isolation
⚫ Integrity Problem
⚫ Atomicity Problem
⚫ Concurrent Access
Anomalies
⚫ Security Problem
Database
⚫A database is an organized collection of data,
generally stored and accessed electronically from
a computer system.
⚫The database management system (DBMS)
⚫is the software that interacts with end users,
applications, and the database itself to capture and
analyze the data.
Organization of Database
Database
Table
Record
Field
Characters
Characters
⚫ A byte of typically 8 bits.
⚫ Each byte represent an characters.
⚫ A Characters can be an Upper Case(A,B,C…..Z),
Lower case(a,b,c,…..z), Numeric digit(0,1,2,….9) are
Special Symbol(.,!,[+],[-]./,…..).
Field
⚫ Character can be combined to form a field.
⚫ Field is a single piece of information.
⚫ It is defined as the smallest unit in a database.
⚫ Eg:
⚫ Roll No
⚫ Name
⚫ Date of Birth
⚫ Sex
⚫ Address
Roll Name Date of Sex Address
Number Birth
20MC001 Aarthi 22.02.1999 Female Salem
20MC002 Dinesh 23.05.1999 Male Erode
20MC003 Kanishka 09.09.1999 Female Namakkal
Records
⚫ All the related files for an particular event
are called a record.
⚫ In another words records is one complete
set of fields.
Table
⚫ Table is a collection of
records.
First Last Age Address Tel
Name Name Number
Aarthi A 21 Salem XXXXXXX
X
Dinesh S 20 Erode XXXXXXX
X
Kanishka R 20 Namakkal XXXXXXX
X
Schema
⚫ The term schema is used to mean an overall chart
of all the data item types and record types stored in
a database.
One to One
One to Many
Many to Many
Sub-Schema
⚫ The term sub-schema refers to the same view but for the
data item types and record types which a particular user
uses in a particular application.
⚫ The many different sub-schema can be derived from one
schema.
⚫ This is external view of database.
Data Models
⚫ Data Model is a collection of concept that
can be used to describe structure of the
database.
⚫ Structure of the database means data type
relationship
constraints that should hold the data.
⚫ Data model the set of basic operation for
specifying
retrieve and update the database.
⚫ Data model is a collection of conceptual
tools,
1.Data
2.Data Relationship
3.Data Semantics.
Categories of Data
Models:
Categories of Data
Models
Relational Hierarchical
Model Model
Network Entity Relationship
Model Model
Object -Oriented
Model
Relational Model
⚫ This model represent data and relationship
among data by a collection of tables known as
relationship.
⚫ A number of columns unique names.
⚫ Relationship model relate records by the value
that
contain.
Advantage:
• Easy to use
• Flexibility
• Precision
• Security
• Data Independence
Relational Database Management System(RDBMS)
⚫ A DBMS is software designed to assist in
maintaining and utilizing large collection of
data.
⚫ DBMS provides an environment that is both
convenient and efficient to use.
⚫ A DBMS is a combination of hardware and
software that can be used to setup and monitor
a database and manage the updating and
retrieval of database.
⚫ Microsoft access.
⚫ SQL Server
⚫ Oracle
⚫ mongoDB
⚫ PostgreSQL
Objective of RDBMS
Shareability :
⚫ An ability to share data resources is a fundamentals objective
of RDBMS.
⚫ The different people and different processes using the
same actual data at virtually the same time.
Availability:
⚫ It means the data of an organization to the user of that
data.
⚫ The system which manage the data resource should be
easily accessible to the
people within an organization.
Evolvability:
⚫ It refers to the ability of the R DBMS to change in
response to growing user
needed and advising technology.
Integrity
⚫ Protecting the extension of the database.
⚫ Maintaining the quality of the database.
Advantages Of DBMS:
⚫ Redundancy can be reduced.
⚫ Inconsistency can be avoided.
⚫ Data can be shared.
⚫ Standard can be enforced.
⚫ Security can be applied.
⚫ Integrity can be maintained.
Database Application:
⚫ Airlines.
⚫ Education.
⚫ Banking.
⚫ Telecommunications
.
⚫ Credit card
Transaction.
⚫ E-Commerce.
⚫ Finance.
⚫ Sales.
KEYS
⚫ A key is single attribute are combination of two
or more attributes of an entity set that is used to
identify one or more instances of set.
⚫ Basic requirement of a relational database
model.
⚫ Used to identify the tuples(rows) uniquely in the
table.
⚫ Used to set up relations amongst various
columns and tables of a relational database
Types of Keys:
• Primary Key.
• Super Key.
• Candidate Key.
• Foreign Key.
• Alternate Key.
Primary Key:
⚫ A primary key is a field that uniquely
identified each record in a table.
⚫ It is a unique key.
⚫ It can identify only one tuple (a record) at a
time.
⚫ It has no duplicate values, it has unique
values.
⚫ It cannot be NULL.
Example
STUD_NO SNAME ADDRESS PHONE
1 Shyam Delhi 123456789
2 Rakesh Kolkata 223365796
3 Suraj Delhi 175468965
Candidate Key:
The minimal set of attributes that can uniquely
identify a tuple is known as a candidate key.
It is a minimal super key.
It is a super key with no repeated data is called a
candidate key.
The minimal set of attributes that can uniquely
identify a record.
It must contain unique values.
It can contain NULL values.
Every table must have at least a single candidate key.
A table can have multiple candidate keys but only one
primary key.
Table STUDENT
STUD_NO SNAME ADDRESS PHONE
1 Shyam Delhi 123456789
2 Rakesh Kolkata 223365796
3 Suraj Delhi 175468965
Table STUDENT_COURSE
STUD_NO TEACHER_NO COURSE_NO
1 001 C001
2 056 C005
{STUD_NO, COURSE_NO} is a composite
candidate key for relation STUDENT_COURSE.
Super Key:
The set of attributes that can uniquely identify
a tuple is known as Super Key. For Example,
STUD_NO, (STUD_NO, STUD_NAME), etc. A
super key is a group of single or multiple keys
that identifies rows in a table. It supports NULL
values.
Adding zero or more attributes to the
candidate key generates the super key.
A candidate key is a super key but vice
versa is not true.
Super Key values may also be NULL.
Table STUDENT
STUD_NO SNAME ADDRESS PHONE
1 Shyam Delhi 123456789
2 Rakesh Kolkata 223365796
3 Suraj Delhi 175468965
STUD_NO+PHONE is a super key.
Relation between Primary Key, Candidate Key, and
Super Key
Foreign Key:
If an attribute can only take the values which are
present as values of some other attribute, it will
be a foreign key to the attribute to which it
refers.
It is a key which acts as a primary key in one
table and it acts as a secondary key in
another table.
It combines two or more relations (tables) at
a time.
They act as a cross-reference between the
tables
Alternative key:
The candidate key other than the primary key
is called an alternate key .
All the keys which are not primary keys are
called alternate keys.
It is a secondary key.
It contains two or more fields to identify two or
more records.
These values are repeated.
E.g. SNAME, and ADDRESS is Alternate keys
Thanks