Unit 2
Unit 2
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 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
Example:-
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
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.
• 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