0% found this document useful (0 votes)
32 views41 pages

Unit 2

The document discusses different data models including relational, hierarchical, network models and entity relationship (ER) model. It explains key concepts of each model such as entities, attributes, relationships and different types of relationships. The relational model introduced the use of structured query language (SQL) and provided advantages like data independence, ease of use and support for complex relationships. ER modeling diagrams graphically represent real world entities and relationships between them using basic symbols.

Uploaded by

adityahada00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views41 pages

Unit 2

The document discusses different data models including relational, hierarchical, network models and entity relationship (ER) model. It explains key concepts of each model such as entities, attributes, relationships and different types of relationships. The relational model introduced the use of structured query language (SQL) and provided advantages like data independence, ease of use and support for complex relationships. ER modeling diagrams graphically represent real world entities and relationships between them using basic symbols.

Uploaded by

adityahada00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Relational Database Management

System
CHAPTER-2
Data Models
Data Models
A database model may be a form of data model that determines the logical structure
or variety of a database and essentially determines during which manner data is keep,
organized, and manipulated.

The most standard example of a info model is:- relational model, which uses a table-
based format.
Data models outline however data is connected to every alternative and
how they're processed and stored inside the system.

Data Model: a group of ideas to explain the structure or variety of a database,


and certain constraints that the database should obey.
Data Model Operation

Data Model Operations: The Operations is used for specifying database retrievals
and updates by referring to the concepts of the data model. An Operations on the
data model may include basic operations and user-defined operations.
Data Model Basic Building Blocks

Entity:-
Anything regarding that information are collected/stored.
An entity is associate degree object that exists and is distinguishable
from different objects.
Example: specific person, company, event, plant
An entity set could be a set of entities of the same type that share the
same properties.
Example: set of all persons, companies, trees, holidays
Data Model Basic Building Blocks

An entity is represented by a collection of attributes; i.e., descriptive properties

possessed by all members of an entity set.

Example:-

teacher = (ID, name, street, city, earnings ).

course= (course_id, title, credits).

A set of the attributes type a primary key of the entity set;

i.e., uniquely identifying each member of the set.


Data Model Basic Building Blocks

Attribute
Characteristic of an entity
Relationship
Describes an association among entities
One-to-one (1:1) relationship (1 student enroll for one course)
One-to-many (1:M) relationship (1 company many departments)
Many-to-one (M:1) relationship (Many seller 1 product)
Many-to-many (M:N or M:M) relationship (many books many authors)
Constraint
A restriction placed on the data
Importance of Data Models

◼ Data models

◼ Representation generally graphical of complex real-world data structures.

◼ Facilitate interaction among the designer, the applications programmer and


the end user

◼ End-users have different views and needs for data

◼ Data model organizes data for various users


Categories of data models
• Conceptual (high-level, semantic) data models:- Provide concepts that are
close to the way many users perceive(distinguish) data. (Also called entity-
based or its also called object-based data models.)

• Physical (low-level, internal) data models:- Provide concepts that describe


details of how data is stored in the computer.

• Implementation (representational/External) data models:- Provide concepts


that fall between the above two, balancing user views with some computer
storage details.
Database Relationship

A relationship is represented by diamond shape in Entity Relational diagram, it


shows the relationship among entities. There are four types of relationships:
1. One to One
2. One to Many
3. Many to One
4. Many to Many
One to One Relationship
• When a one instance of an entity is associated with a one
instance of another entity then it is called one to one
relationship. For eg:- , a person has only one passport and a
passport is given to one person.

Image from self


One to Many Relationship

When a one instance of an entity is associated with more than one instances of
another entity then it is called one to many relationship. For eg:- a customer can
place many orders but a order cannot be placed by many customers.

Image from self


Many to One Relationship
• When more than single instances of an entity is associated with
a single instance of another entity then it is called many to one
relationship. For eg:– many students can study in a single
college but a student cannot study in many colleges at the same
time.
Many to Many Relationship
• When more than single instances of an entity is associated with
more than single instances of another entity then it is called
many to many relationship. For eg:-, a can be assigned to many
projects and a project can be assigned to many students.
Hierarchical Model
• In this model every entity has only single parent but will have many children .
At the top of hierarchy there's only 1 entity that is named Root.

• A hierarchical database model is a data model in which the data is organized


into a tree-like structure. ... The hierarchical database model mandates that
each child record has only 1 parent, whereas every parent record can have
one or more child records.
Hierarchical Model
Advantages of Hierarchical Model

•Have many different structures and forms.


•Structures data in an upside-down tree. (Simplifies data overview)
•Manages large amounts of data.
•Express the relationships between information.
•Many children per parent.
•Distribute data in terms of relationships.
•Improve data sharing.
Network Model
•The network model, entities are organised in a graph, in which few entities can be
accessed through several path.
•A network model is a database model that is designed as a flexible approach to
representing object and their relationships. A unique features of the network
model is its schema, which is viewed as a graph where relationship types are arcs
and object types are nodes.
Advantages Of Network Model
•The Simple Concept: Similar to the hierarchical model, this model is simple and
the implementation is effortless.
•The Ability to Manage More Relationship Types: The network model has the
ability to manage one-to-one (1:1) as well as many-to-many (N: N) relationships.
•Easy Access to Data: Accessing the data is simpler when compared to the
hierarchical model.
•Data Integrity: In a network model, there's always a connection between the
parent and the child segments because it depends on the parent-child
relationship.
•The Data Independence: Data independence is better in network models as
opposed to the hierarchical models.
Disadvantages Of Network Model

•Data relationships must be predefined.


•Much more complex than the hierarchical date model.
•Users are still require to know the physical representation of the
database
•Information can be related in various and complicated ways.
•Lack structural independence.
Relational Model

• The relational data model was introduced in 1970 by Edgar F.


Codd. He worked for IBM. All data is represented as simple
tabular data structures which the user can access through a high-
level non-procedural language. In 1974 IBM proposed a new
high-level non-procedural language – SEQUEL (renamed into SQL
in 1990).
Advantages Of Relational Model
• Structured independence is promoted.
• Users do not have to know the physical representation of the database.
• Use of SQL language to access data.
• Easier database design.
• Tabular view improves simplicity.
• Support large amounts of data.
• Data independence.
• Multi-level relationships between data sets
• No need to predefined data relationships.
Disadvantages Of Relational Model

• Data anomalies.
• People need training if they want to use the system effectively and
efficiently.
CHAPTER-2
Entity Relationship Modelling
E-R Model
• E-R diagram is that the short name of “Entity-Relationship”
diagram.
• AN E-R diagram with efficiency shows the relationships between
numerous entities hold on in an exceedingly info.
Components of an E-R Model
1. Entity
2. Attribute
3. Relationship
Entity
Any real-world object will be delineated as associate in nursing entity concerning that
knowledge will be keep during a information.
All realistic world objects sort of a book, a company, a product, a car, someone square
measure the samples of an entity.
Any living or non-living objects will be delineated by an entity. An entity is symbolically
delineated by a parallelogram in closure its name.
Types of Entity
Entities can be characterized into two types:
1. Strong entity: A strong entity has a primary key attribute which individually
identifies each entity. Representation of strong entity is identical as an
entity.
Types of Entity
2. Weak entity: A weak entity does not have a primary key attribute and
depends on other entity via a foreign key attribute.
Attribute
Each entity features a set of properties. These properties of every entity ar termed as
attributes. for instance, a automobile entity would be delineate by attributes like worth,
identification number, model range, color etc. Attributes ar indicated by ovals in associate
e-r diagram.
Types Of Attribute
A primary key attribute is delineate by associate degree underline within the e-r diagram.
associate degree attribute are often characterised into following types:
Simple attribute:- associate degree attribute is assessed as an easy attribute if it can't be
divided into smaller parts. as an example, age and sex of an individual. an easy attribute is
delineate by associate degree oval.
Composite attribute:- A composite attribute are often divided into smaller parts that more
type attributes. as an example, ‘name’ attribute of associate degree entity “person” are
often lessened into given name and surname that more type attributes. Grouping of those
connected attributes forms a composite attribute. ‘name is that the composite attribute
during this example.
Types Of Attribute
Single valued attribute:- If an attribute of a specific entity represents single value for every
instance, then it's referred to as a single-valued attribute. as an example, Ramesh, Kamal
and Suraj square measure the instances of entity ‘student’ and every of them is issued a
separate roll variety. one oval is employed to represent this attribute.
Multi valued attribute:– an attribute which may hold over one value, it's then termed as
multivalent attribute. as an example, signalling of an individual. image of multivalent
attribute is shown below Derived attribute: A derived attribute calculate its worth from
another attribute. as an example, ‘age’ could be a derived attribute if it calculates its worth
from ‘current date’ & ‘birth date’ attributes. A derived attribute is depicted by a broken oval.
Entity List , E-R Diagram
Entity List , E-R Diagram
Components Of ER Diagram in DBMS
•Rectangle
•Ellipse
•Diamond
•Lines
•Double Rectangle
•Double Ellipse
•Double Lines
•Dashed Ellipse
E-R Diagrams
1.Student Reading System
student and books are the two entities. Both of them may have their own
attributes. The student entity may have attributes like student_name, roll_no,
address, date_of_birth, phone_number etc. And on the other hand, the books
entity may have attributes like book_name, ISBN, author, price etc.
E-R Diagrams
Diamonds are used for defining the relationship between two or more entities. In
the above example, if we consider “student reads books” then “reads” will be the
relationship between the two entities student and books. All entities with their
attributes and all the entities with relationships are linked by lines.
E-R Diagram for bank system

Image from google


E-R Diagram for Library Management system

Image from google


For practice
1. Inventory management system
2. Employee management system
3. Railway reservation system
4. Movie Database system
E-R Diagram Model

You might also like