You are on page 1of 34

I N T R O D U C T I O N TO

RDBMS
B Y: Aniruddha Halder

Wo m e n ’s P o l y t e c h n i c , C h a n d a n n a g a r
What is Database Management System?
A Database Management System (DBMS), or simply a Database System (DBS)
consist of :
 A collection of interrelated and persistent data (usually referred to as the
database (DB)).
 A set of application programs used to access, update and manage that data
(which form the data management system (MS)).

 A database management system (DBMS) that incorporates the relational-data model,


normally including a Structured Query Language (SQL) application programming
interface. It is a DBMS in which the database is organized and accessed according to the
relationships between data items. In a relational database, relationships between data
items are expressed by means of tables.
Brief History
 Early 1960s: first general purpose database by Charles Bachman
from GE. Used the network data model.
 late 1960s: IBM developed Information Management System (IMS).
Used the hierarchical data model. Led to SABRE, the airline
reservation system developed by AA and IBM. Still in use today.

 1970: Edgar Code of IBM developed the relational data model. Led to
several DBMS based on relational model, as well as important
theoretical results. Code wins Turing award.

 1980s: relational model dominant SQL standard.

 Late 1980s, 1990s: DBMS vendors extend systems, allowing more


complex data types (images, text).
Why Use a DBMS?
Data independence and efficient access.

 Reduced application development time.

 Data integrity and security.

 Uniform data administration.

 Concurrent access, recovery from crashes.


Purpose of DBMS
• To Avoid Data redundancy and inconsistency :
 Same information may be duplicated in several places.
 All copies may not be updated properly.
 Difficulty in new program to carry out each new task.
• Data isolation
 Data in different formats.
Difficult to write new application programs.
Files and formats
More on Purposes of DBMS …
• Security problems :
 Every user of the system should be able to access only the data they are
permitted to see.
Example: In payroll system people only handle employee records, and cannot see customer accounts;
tellers only access account data and cannot see payroll data.
Difficult to enforce this with application programs.
• Integrity problems :
 Every Data may be required to satisfy constraints.
Example: No account balance below ₹2000.
Difficult again, to enforce or to change constraints with the file-processing approach.
Database Administrator and Responsibilities
• Database Administrator (DBA):
A database administrator's (DBA) primary job is to ensure that data is available, protected
from loss and corruption, and easily accessible as and when needed. 
The system administrator sets up hardware and deploys the
• operating system for the database server, then the DBA
Software installation and Maintenance:
installs the database software and configures it for use.

•  Data Extraction, Transformation, and Loading:


Known as ETL, data extraction, transformation, and loading refers to efficiently importing large volumes of
data that have been extracted from multiple systems into a data warehouse environment.

This external data is cleaned up and transformed to fit the desired format so that it can be imported into a
central repository.
• Specialised Data Handling:
Today’s databases can be massive and may contain unstructured data types such as images, documents, or
sound and video files. Managing a very large database (VLDB) may require higher-level skills and additional
monitoring and tuning to maintain efficiency.
DBA and its Responsibilities Continued..
• Database Backup and Recovery:
DBAs create backup and recovery plans and procedures based on industry best practices, then make sure that
the necessary steps are followed. Backups cost time and money, so the DBA may have to persuade
management to take necessary precautions to preserve data.
•  Security: A DBA needs to know potential weaknesses of the database software and the
company’s overall system and work to minimize risks. No system is one hundred per cent immune to attacks,
but implementing best practices can minimize risks.
• Authentication: Setting up employee access is an important aspect of database security.
DBAs control who has access and what type of access they are allowed. For instance, a user may have
permission to see only certain pieces of information, or they may be denied the ability to make changes to the
system.
• Capacity Planning: The DBA needs to know how large the database currently is and how
fast it is growing in order to make predictions about future needs. Storage refers to how much room the
database takes up in server and backup space. Capacity refers to usage level.

Monitoring databases for performance issues is part of the on-going system


• Performance Monitoring:
maintenance a DBA performs. 
• Database Tuning: • Troubleshooting:
Data Dictionary (DD) & its Functions
A data dictionary contains metadata i.e. data
about the database. The data dictionary is
very important as it contains information
such as what is in the database, who is
allowed to access it, where is the database
physically stored etc. The users of the
database normally don't interact with the
data dictionary, it is only handled by the
database administrators.

• Names of all the database tables and their schemas.


• Details about all the tables in the database, such as their owners, their security constraints, when they were created etc.
• Physical information about the tables such as where they are stored and how.
• Table constraints such as primary key attributes, foreign key information etc.
• Information about the database views that are visible.
Data Models
• Hierarchical • Network • Relational • Object Oriented
 The hierarchical data model organizes data in a
tree structure. There is a hierarchy of parent
and child data segments. This structure implies
that a record can have repeating information,
generally in the child data segments.

 The hierarchical DBMSs were popular from the


late 1960s, with the introduction of IBM's
Information Management System (IMS)
DBMS, through the 1970s.

Advantages & Disadvantages (H/T)


Data Models
• Network Model
 The popularity of the network data model
coincided with the popularity of the
hierarchical data model. Some data were more
naturally modeled with more than one parent
per child.
 The network model permitted the modeling of
many – to - many relationships in data. In
1971, the Conference on Data Systems
Languages (CODASYL) formally defined the
network model.

Advantages & Disadvantages (H/T)


Data Models
• Relational Model
 The A relational database allows the definition
of data structures, storage and retrieval
operations and integrity constraints.

 In such a database the data and relations


between them are organized in tables. A table
is a collection of records and each record in a
table contains the same fields.

 (RDBMS - relational database


management system) A database based on
the relational model developed by E.F.
Code. Advantages & Disadvantages (H/T)
Properties of Relational Tables
 The Values Are Atomic.
 Each Row is Unique.
 The Column Values Are of the Same Kind.
 The Sequence of Columns is Insignificant.
 The Sequence of Rows is Insignificant.
 The Each Column Has a Unique Name.
Data Models
• Object-Oriented Model
 Object DBMSs add database functionality
to object oriented programming
languages. They bring much more than
persistent storage of programming
language objects.

 A major benefit of this approach is the


unification of the application and database
development into a seamless data model and
language environment.

Advantages & Disadvantages (H/T)


Data Models
• Semi structured Model
 In semi structured data model, the information
that is normally associated with a schema is
contained within the data, which is sometimes
called “self-describing”.

 In such database there is no clear separation


between the data and the schema, and the
degree to which it is structured depends on
the application.
Advantages & Disadvantages (H/T)
Sources:
•E-mails •XML and other markup languages •Binary executables •TCP/IP packets
•Zipped files •Integration of data from different sources •Web pages
Architecture of DBMS / Data Abstraction
 In An early proposal for a standard terminology External / User Level
and general architecture database a system was Conceptual / Logical Level
produced in 1971 by the DBTG (Data Base Task Internal / Physical Level
Group) appointed by the Conference on data
Systems and Languages (CODASYL).

 The DBTG recognized the need for a two level


approach with a system view called the schema
and user view called subschema. The American
National Standard Institute terminology and
architecture in 1975. ANSI-SPARC recognized
the need for a three level approach with a
system catalog.

 There are three levels or layers of DBMS


architecture:
Levels or Layers of DBMS Architecture
External Level: External Level is described by a schema i.e. it consists of definition of
logical records and relationship in the external view.
Conceptual Level: Conceptual Level represents the entire database. Conceptual schema
describes the records and relationship included in the Conceptual view.

Internal Level: Internal level indicates how the data will be stored and described the data
structures and access method to be used by the database.
Components of DBMS
• Hardware: Can range from a PC to a network of computers.
• Software: DBMS, operating system, network software (if necessary) and also the application
programs.
• Data: Used by the organization and a description of this data called the schema.
• People: Includes database designers, DBAs, application programmers, and end-users.
• Procedure: Instructions and rules that should be applied to the design and use of the database and DBMS.
Advantages of DBMS Over File Management System
• Controlling Redundancy.
• Sharing of Data.
• Data Consistency.
• Integration of Data.
• Integration Constraints.

• Data Security.
• Report Writers.
• Control Over Concurrency.
• Backup and Recovery Procedures.
• Data Independence (At the Logical & Physical Level).
Write Short notes on Logical & Physical data independence
Disadvantages of DBMS
• Cost of Hardware and Software .
• Cost of Data Conversion.
• Cost of Staff Training.
• Appointing Technical Staff.
• Database Damage & Migration.

https://beginnersbook.com/2015/04/dbms-tutorial/
Entity Relationship Model (ER) of DBMS
An Entity–relationship model (ER model) describes the visual 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.

Components of a ER Diagram
• Rectangle: Represents Entity sets.
• Ellipses: Attributes.
• Diamonds: Relationship Set.
• Lines: They link attributes to Entity Sets and Entity sets to Relationship Set.
• Double Ellipses: Multivalued Attributes.
• Dashed Ellipses: Derived Attributes.
• Double Rectangles: Weak Entity Sets.
• Double Lines: Total participation of an entity in a relationship set.
E ntity
An entity can be a real-world object, either animate or inanimate, that can be easily
identifiable. For example, in a school database, students, teachers, classes, and courses offered
can be considered as entities. All these entities have some attributes or properties that give

them their identity.
An entity set is a collection of similar types of entities. An entity set may contain entities
with attribute sharing similar values. For example, a Students set may contain all the
students of a school; likewise a Teachers set may contain all the teachers of a school from all
faculties. Entity

sets need not be disjoint.
Attributes
Entities are represented by means of their properties, called attributes. All attributes have
values. For example, a student entity may have name, class, and age as attributes.

There exists a domain or range of values that can be assigned to attributes. For example, a
student's name cannot be a numeric value. It has to be alphabetic. A student's age cannot be
negative, etc.
Types of Attributes
Simple attribute − Simple attributes are atomic values, which cannot be divided further. For
example, a student's phone number is an atomic value of 10 digits.

Composite attribute − Composite attributes are made of more than one simple attribute. For
example, a student's complete name may have first_name and last_name.

Derived attribute − Derived attributes are the attributes that do not exist in the physical
database, but their values are derived from other attributes present in the database. For
example, average_salary in a department should not be saved directly in the database,
instead it can be derived. For another example, age can be derived from date_of_birth.

Single-value attribute − Single-value attributes contain single value. For example −


Adhaar_Number.
Multivalued attribute − Multivalued attributes may contain more than one values. For
example, a person can have more than one phone number, email_address, etc.
Entity-Set and Keys
Key is an attribute or collection of attributes that uniquely identifies an entity among entity
set. For example, the REGISTRATION_NUMBER of a student makes him/her identifiable
among students.
There are mainly three types of keys:
Super Key − A set of attributes (one or more) that collectively identifies an entity in an entity
set.
Candidate Key − A minimal super key is called a candidate key. An entity set may have more
than one candidate key.
Primary Key − A primary key is one of the candidate keys chosen by the database designer
to uniquely identify the entity set.
Relationship
The association among entities is called a relationship. For example, an employee works_at a
department, a student enrolls in a course. Here, Works_at and Enrolls are called
relationships.

Relationship Set: A set of relationships of similar type is called a relationship set. Like
entities, a relationship too can have attributes. These attributes are called descriptive
attributes. Descriptive Attributes H/T
Degree of Relationship: The number of participating entities in a relationship defines the
degree of the relationship.
Binary = degree 2
Ternary = degree 3
N - ary = degree n
Mapping Cardinalities
Cardinality defines the number of entities in one entity set, which can be associated with the
number of entities of other set via relationship set.
Types of Cardinalities
One-to-one: One entity from entity set A can be associated with
at most one entity of entity set B and vice versa.

One entity from entity set A can be associated with


One-to-many: more than one entities of entity set B, however, an
entity from entity set B, can be associated with at most
one entity.
More than one entities from entity set A can be associated
Many-to-one: with at most one entity of entity set B, however, an entity
from entity set B can be associated with more than one
entity from entity set A.

Many-to-many: One entity from A can be associated with more


than one entity from B and vice versa.
Entity Relationship Diagram (ERD) of DBMS
Entities: An entity is an object or concept about
which you want to store information.

A weak entity is an entity that must defined by a


foreign key relationship with another entity as it
cannot be uniquely identified by its own
attributes alone.

Actions / Relations: Actions / Relations are


represented by diamond shape, and show how
two, entities share information in the database.
More on Entity Relationship Diagram (ERD) of DBMS
In some cases, entities can be Self - linked. Supervised
For example, employees can supervise other
employees.
Attributes: Attributes are represented by ovals. A
key attribute is the unique, distinguishing
characteristic of the entity.
For example, an employee's Adhaar number might be the employee's
key attribute.
A multivalued attribute can have more than one value. For example, an
employee entity can have multiple skill values.

A derived attribute is based on another attribute. For example, an


employee's monthly salary is based on the employee's annual salary.
More on Entity Relationship Diagram (ERD) of DBMS
Connecting lines: Solid lines that connect attributes to show the relationships of entities in the
diagram.
Cardinality: Cardinality specifies how many
instances of an entity relate to one instance of
another entity.
Ordinality is also closely linked to cardinality.
While cardinality specifies the occurrences of a
relationship, ordinality describes the relationship as
either mandatory or optional. In other words,
cardinality specifies the maximum number of
relationships and ordinality specifies the absolute
minimum number of relationships.
INFORMATION ENGINEERING STYLE USED IN ER-
DIAGRAM (ERD) of DBMS
Relationships (Cardinality and Modality)
SYMBOLS MEANING
Zero or One
One or More
One and only One
Zero or More
A one through many notation on one side of a relationship and a one and only
one on the other.
A zero through many notation on one side of a relationship and a zero or one
notation on the other.
A one through many notation on one side of a relationship and a zero or one
notation on the other.
A zero through many notation on one side of a relationship and a one and
only one notation on the other.
EXTENDED FEATURES OF ERD
Introduction: The ER Model has the power of expressing database entities in a
conceptual hierarchical manner. As the hierarchy goes up, it
generalizes the view of entities, and as we go deep in the hierarchy, it
gives us the detail of every entity included.

Generalization is a bottom-up approach in


which multiple lower-level entities are
combined to form a single higher-level
entity. Generalization is usually used to find
common attributes among entities to form a
generalized entity. It can also be thought of as
the opposite of specialization.
EXTENDED FEATURES OF ERD
Specialization is a top-down approach in
which a higher-level entity is divided into
multiple specialized lower-level entities. In
addition to sharing the attributes of the
higher-level entity, these lower-level entities
have specific attributes of their own.
Specialization is usually used to find subsets
of an entity that has a few different or
additional attributes. It can also be thought of
as the opposite of generalization.

Distinguish between Generalization & Specialization (H/T)???


EXTENDED FEATURES OF ERD
Aggregation refers to the process by which
entities are combined to form a single
meaningful entity. The specific entities are
combined because they do not make sense on
their own. To establish a single entity,
aggregation creates a relationship that combines
these entities. The resulting entity makes sense
because it enables the system to function well.

Comparative study between Generalization & Specialization & Aggregation (H/T).


Client-server Architecture in DBMS
In client-server architecture many clients connected with
one server. The server is centrelines, it provides services to
all clients. All clients request to the server for different
Service. The server displays the results according to the
client’s request.

Structure of Client-server Architecture in DBMS


By using this architecture structure this software is divided into three different tiers:
 Presentation tier  Logic tier  Data tier
This is the
the first
DBMS and layer.
topmostThislevel of the
layer application.
consist The basic
of database. It canwork of this
be used layer provides
through the business
user interface.
services layer. The interface
In this layer,isdata
generally a graphical
is stored user interface.
and retrieved. The responsibility of this layer to
keep
The data consistent
logical tier is andalsoindependent.
known as data access tier or middle tier. It lies between the
presentation
Providing data tier
its and
ownthetier data tier. It controls
also improves the and
scalability application’s functions
performance. by performing
This layer consists of
processing. The components that build this layer exist on the server, assist the resources
data access components.
sharing.
Advantages and Disadvantages of Client Server Architecture(H/T).

You might also like