You are on page 1of 28

Database Management System

(CSE249)
UNITS
UNIT 1 INTRODUCTION TO DATABASES

UNIT 2 RELATIONAL DATABASE LANGUAGE & INTEFACES

UNIT 3 NORMALIZATION IN DESIGN OF DATABASES

UNIT 4 TRANSACTION MANAGEMENT


UNIT 5 CONCURRENCY CONTROL
Contents – UNIT 1
Introduction to Databases
Unit 1 Topic 1 Introduction of DBMS, Characteristic of DBMS, Data
Models, Database languages, Database Administrator,
Database Users

Unit 1 Topic 2 Three Schema architecture of DBMS, Data Models,


Hierarchical, Network ,Data independence and
database language, DDL, DML, Data Modeling using
Entity Relationship Model
Unit 1 Topic 3 Strong Entity, Weak entity, Specialization and
generalization, converting ER Model to relational
tables
Introduction To Databases
• Three Schema architecture of DBMS
• Data Models, Hierarchical, Network
• Data independence
• Database language, DDL, DML
• Data Modeling using Entity Relationship Model
Data Modeling

Basic flow control on the data modeling


Data Modeling
• Data Model describes a way to design database at physical,
logical and view level.
• A Database model defines the logical design and structure of
a database and defines how data will be stored, accessed and
updated in a database management system.
• While the Relational Model (Record-based
Logical Data Model) is the most widely used database model,
there are other models too:
– Hierarchical Model
– Network Model
– Entity-relationship Model
– Relational Model
Hierarchical Model
• In the hierarchical model, data is organized as an inverted
tree.
• Each entity has only one parent but can have several children.
• At the top of the hierarchy, there is one entity, which is called
the root.

An example of the hierarchical model representing a university


Network Model
• In the network model, the entities are organized in
a graph, in which some entities can be accessed
through several paths.

An example of the Network Model representing a university


E-R Model
• Entity-Relationship Model or E-R Model was developed
by Peter Chen in 1976.
• E-R Model can be expressed as the collection of entities,
also called as real word objects and relations between
those entities.
• No two entities should be identical.
• E-R Model shows the conceptual view of the database
(Conceptual Data Models).
• E-R Model is formed by the entity set, relationship set and
the attributes.
Relational Model
• This model was introduced by E.F Codd in 1970, and since then it has
been the most widely used database model, infact, only database model
used around the world.
• In the relational model, data is organized in two-dimensional tables
called relations.
• The tables or relations are, however, related to each other.

An example of the Relational Model representing a university


Relational Model
• The basic structure of data in the relational model is tables.
• All the information related to a particular type is stored in
rows of that table.
• Hence, tables are also known as relations in relational model.
ER Model to Relational Model
• E-R Models are defined to represent the relationships into
pictorial form to make it easier for different stakeholders to
understand.
• This model is good to design a database, which can then be
turned into tables in relational model.
E-R Model
A data model consists of entities related to each other:

Data Model Definition


Element
Entity A real world thing or an interaction between 2 or more real
world things.

Attribute The atomic pieces of information that we need to know about


entities.
Relationship How entities depend on each other in terms of why the entities
depend on each other (the relationship) and what that
relationship is (the cardinality of the relationship).
Components of an ERD
• An ERD typically consists of four different graphical
components:
• Entity
– Weak and Strong Entity
• Attribute
– Types of Attributes
• Relationship
– Cardinality
• Keys
– Types of Keys
Attributes
• Each entity is described by a set of attributes/properties.
• Student entity
StudName – name of the student.
RollNumber – the roll number of the student.
Address – the address of the student etc.
• All entities in an Entity set/type have the same set of
attributes.
Simple ER Diagram Example
Types of Attributes
• In Entity Relationship(ER) Model attributes can be classified
into the following types:
– Simple and Composite Attribute
– Single Valued and Multi Valued attribute
– Stored and Derived Attributes
A Simple key attribute
A composite attribute

An attribute
broken into
component parts
Diagrammatic Notation for Entities
entity - rectangle
attribute - ellipse connected to
rectangle
multi-valued attribute - double
ellipse
composite attribute - ellipse
connected to ellipse
Lname derived attribute - dashed
Program
ellipse

Fname Mname

Sex RollNumber

StudName
Student

Admissio
Entity with a multivalued attribute (Skill) and derived
attribute (Years_Employed)
An attribute that is both multivalued and composite
Another Example
Notations Of Attributes in ER Diagram 
BASIS FOR COMPARISON E-R MODEL RELATIONAL MODEL

Basic It represents the collection It represents the collection


of objects called entities of Tables and the relation
and relation between those between those tables.
entities.

Describe Entity Relationship Model Relational Model describes


describe data as Entity set, data in a table as Domain,
Relationship set and Attributes, Tuples.
Attribute.

Relationship E-R Model is easier to Comparatively, it is less easy


understand the relationship to derive a relation between
between entities. tables in Relational Model.

Mapping E-R Model describes Relational Model does not


Mapping Cardinalities. describe mapping
cardinalities.
Hierarchical Data Network Data Models Relational Data
Model Models
Supports One-Many Supports both one to Supports both one to
Relationship many and Many to many and Many to
Many relationship Many relationship
Because of single It establishes the It provides SQL, which
parent-child relationship between makes the access to the
relationship, difficult to most of the objects, data simpler and
navigate through the hence easy to access quicker.
child compared to
hierarchical model
Flexibility among the Because of the mapping Primary and foreign
different object is among the sub level key constraint makes the
restricted to the child. tables, flexibility is flexibility much
more simpler than other
models.

Based on the physical Based on the physical Based on the logical


storage details storage details data view

You might also like