The document discusses concepts related to Entity-Relationship (E-R) diagrams and database modeling. It defines key terms like entities, attributes, relationships and describes different types of attributes and relationships like one-to-one, one-to-many, etc. It also covers topics like weak entity sets, participation constraints and mapping cardinality which define the number of entities that can be associated in a relationship. Examples of E-R diagrams for different domains are provided to demonstrate how to model entities, attributes and relationships for a database.
chapter 3-Data Modelling using Entity Relationship .pdfMisganawAbeje1
it describes about Data Model Basic Building Blocks in Using High level Data Models for Database Design Entity types and Sets, Attributes and Keys, Relationships, Roles and Structural Constraints, Enhanced ER Diagram, E-R mapping to Relational Database model.
You can get clear knowledge about the functional dependencies in "Normalization". And also the rules, types of FDs and finally the closure and its applications
Welcome to my series of articles on Unified Modeling Language. This is "Session 7 – Deployment Diagram" of the series. Please view my other documents where I have covered each UML diagram with examples
chapter 3-Data Modelling using Entity Relationship .pdfMisganawAbeje1
it describes about Data Model Basic Building Blocks in Using High level Data Models for Database Design Entity types and Sets, Attributes and Keys, Relationships, Roles and Structural Constraints, Enhanced ER Diagram, E-R mapping to Relational Database model.
You can get clear knowledge about the functional dependencies in "Normalization". And also the rules, types of FDs and finally the closure and its applications
Welcome to my series of articles on Unified Modeling Language. This is "Session 7 – Deployment Diagram" of the series. Please view my other documents where I have covered each UML diagram with examples
The importance of data models, Basic building blocks, Business rules, The evolution of data models, Degrees of data abstraction
Database design and Introduction to UML
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Understanding Inductive Bias in Machine LearningSUTEJAS
This presentation explores the concept of inductive bias in machine learning. It explains how algorithms come with built-in assumptions and preferences that guide the learning process. You'll learn about the different types of inductive bias and how they can impact the performance and generalizability of machine learning models.
The presentation also covers the positive and negative aspects of inductive bias, along with strategies for mitigating potential drawbacks. We'll explore examples of how bias manifests in algorithms like neural networks and decision trees.
By understanding inductive bias, you can gain valuable insights into how machine learning models work and make informed decisions when building and deploying them.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...ssuser7dcef0
Power plants release a large amount of water vapor into the
atmosphere through the stack. The flue gas can be a potential
source for obtaining much needed cooling water for a power
plant. If a power plant could recover and reuse a portion of this
moisture, it could reduce its total cooling water intake
requirement. One of the most practical way to recover water
from flue gas is to use a condensing heat exchanger. The power
plant could also recover latent heat due to condensation as well
as sensible heat due to lowering the flue gas exit temperature.
Additionally, harmful acids released from the stack can be
reduced in a condensing heat exchanger by acid condensation. reduced in a condensing heat exchanger by acid condensation.
Condensation of vapors in flue gas is a complicated
phenomenon since heat and mass transfer of water vapor and
various acids simultaneously occur in the presence of noncondensable
gases such as nitrogen and oxygen. Design of a
condenser depends on the knowledge and understanding of the
heat and mass transfer processes. A computer program for
numerical simulations of water (H2O) and sulfuric acid (H2SO4)
condensation in a flue gas condensing heat exchanger was
developed using MATLAB. Governing equations based on
mass and energy balances for the system were derived to
predict variables such as flue gas exit temperature, cooling
water outlet temperature, mole fraction and condensation rates
of water and sulfuric acid vapors. The equations were solved
using an iterative solution technique with calculations of heat
and mass transfer coefficients and physical properties.
HEAP SORT ILLUSTRATED WITH HEAPIFY, BUILD HEAP FOR DYNAMIC ARRAYS.
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
Water billing management system project report.pdfKamal Acharya
Our project entitled “Water Billing Management System” aims is to generate Water bill with all the charges and penalty. Manual system that is employed is extremely laborious and quite inadequate. It only makes the process more difficult and hard.
The aim of our project is to develop a system that is meant to partially computerize the work performed in the Water Board like generating monthly Water bill, record of consuming unit of water, store record of the customer and previous unpaid record.
We used HTML/PHP as front end and MYSQL as back end for developing our project. HTML is primarily a visual design environment. We can create a android application by designing the form and that make up the user interface. Adding android application code to the form and the objects such as buttons and text boxes on them and adding any required support code in additional modular.
MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software. It is a stable ,reliable and the powerful solution with the advanced features and advantages which are as follows: Data Security.MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
4. Basicconcepts
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
4
What is Database Design?
Database Design is a collection of processes that facilitate the designing, development,
implementation and
maintenanceof enterprise database management systems.
What is E-R diagram?
E-R diagram: (Entity-Relationship diagram)
It is graphical (pictorial) representationofdatabase.
It uses different types of symbols to represent different objects ofdatabase.
5. Entity
#310703 (DBMS) UNIT 2 – DATA
MODELS
An entity is a person,a place or anobject.
An entity is represented by a rectangle which contains the name of
an entity.
Entities of a college database are:
Student
Professor/Faculty
Course
Department
Result
Class
Subject
Entity Name
Symb
ol
Student Faculty Course
Exercise Write down the different entities of bank
database.
Exercise Write down the different entities of hospital
database.
5
6. EntitySet
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
It is a set (group) of entities of same
type.
Examples:
All persons having an account in a bank
All the students studying in a college
All the professors working in a college
Set of all accounts in a bank
6
7. Attributes
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
Attribute is propertiesor details about an entity.
An attribute is represented by an oval containing name of an
attribute.
Attributes of Student are:
Roll No
Student
Name
Branch
Semester
Address
Mobile No
Age
SPI
Backlogs
Symb
ol
Attribut
e
Name
Student
RollN
o
Nam
e
Exercise Write down the different attributes of Faculty
entity.
Exercise Write down the different attributes of Account
entity.
7
8. Relationship
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
Relationship is an association (connection) between several entities.
It should be placed between two entities and a line connecting it to
an entity.
A relationship is represented by a diamondcontaining relationship's
name.
Relationsh
ip Name
Symbol
Student Book
Issu
e
8
9. E-RDiagramofaLibrarySystem
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
Student Book
Issu
e
RollN
o
Nam
e
Branc
h
Se
m
BookN
o
Nam
e
Autho
r
Pric
e
Primary
Key
Primary
Key
Entitie
s
Attributes
Relationsh
ip
Each and every entity must have one primary key
attribute. Relationship between 2 entities is called
binary relationship.
9
10. TernaryRelationship
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
Faculty Student
Guid
e
FacI
D
Nam
e
Branc
h
Technolog
y
RollN
o
Nam
e
Branc
h
Se
m
Project
P
rojectID
Project
Name
Relationship between 3 entities is called ternary
relationship.
10
11. Exercise
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
11
Draw an E-R diagram of following pair of entities
Customer &Account
Customer & Loan
Doctor & Patient
Student & Project
Student & Teacher
Note: Take four attributes per entity with one primary key
attribute.
Keep proper relationship between two entities.
13. TypesofAttributes
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 13
SimpleAttribute CompositeAttribute
Cannot be divided into subparts Can be divided into subparts
E.g. RollNo, CPI E.g. Name
(first name, middle name, last
name)
Address
(street, road, city)
Symbol
Roll No
Symbo
l
First
name
Name
Middle
name
Last name
14. TypesofAttributes
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 14
Single-valuedAttribute Multi-valuedAttribute
Has single value Has multiple (more than one) value
E.g. RollNo, CPI E.g. PhoneNo
(person may have multiple phone
nos)
EmailID
(person may have multiple emails)
Symbol
Roll No
Symbol
Phone No
15. TypesofAttributes
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 15
StoredAttribute DerivedAttribute
It’s value is stored manually in
database
It’s value is derived or calculated
from other attributes
E.g. Birthdate E.g. Age
(can be calculated using current date
and birthdate)
Symbol
Birthdate
Symbol
Age
16. EntitywithalltypesofAttributes
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 16
Stude
nt
RollN
o
Nam
e
Phone
No
Birth
Date
First
Name
Last
Name
Middl
e
Nam
e
Addres
s
Ag
e
Apartme
nt
Are
a
Stree
t
Composite
Composit
e
Singl
e
SVima
lp
u
l
e
e
Multipl
e
Value
Store
d
Derive
d
17. Exercise
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 17
Draw an E-R diagram of Banking Management
System.
Draw an E-R diagram of Hospital Management
System.
Draw an E-R diagram of College Management
System.
Take only 2 entities
Keep proper relationship between twoentities
Use all types of attributes
18. DescriptiveAttribute
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 18
Student Book
Issu
e
RollN
o
Nam
e
Branc
h
Se
m
BookN
o
Nam
e
Autho
r
Pric
e
Issu
e
Dat
e
Attributes of therelationship is called descriptive
attribute.
Descriptiv
e
Attribute
19. Role
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 19
Roles are indicated by labeling the lines that connect diamonds (relationship) to
rectangles (entity).
The labels “Coordinator” and “Head” are called roles; they specify Faculty entities
interact with whom via Reports_To relationship set.
Role labels are optional, and are used to clarify semantics (meaning) of the
relationship.
EmpI
D
Nam
e
Branc
h
Experien
ce
Faculty
Coordinat
o
Head
r
Reports_
To
20. RecursiveRelationshipSet
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
The same entityparticipatesin a relationship set morethanoncethen it is called recursive
relationship set.
Facult
y
Departme
nt
Work
s
Pos
t
FacID
DeptI
D
FName
DNam
e
Recursive
Relationsh
ip Set
Prof.
FName Post
Ajay Professor
Haresh Professor
Ramesh HOD
DName
Computer
Civil
Mechanical
20
22. MappingCardinality(CardinalityConstraints)
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 22
It represents the numberof entities of anotherentityset which are connectedtoan entity
using a relationship set.
It is most useful in describing binaryrelationshipsets.
For a binary relationship set the mapping cardinality must be one of the following
types:
One to One
One to Many
Many to One
Many to Many
23. One-to-Onerelationship(1– 1)
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 23
An entity in A is associated withonly oneentityin B and an entity in B is associated with
only oneentityinA.
Example: A customer is connected with only one loan using the relationship borrower
and a
loan is connected withonly onecustomerusing borrower.
A
1
A
2
B
1
B
2
A B
loan
customer
borro
w
C1
C
2
L
1
L
2
C
3
L
3
24. One-to-Manyrelationship(1– N)
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 24
An entity in A is associated withmorethanoneentities in B and an entity in B is associated
withonly oneentityin A.
A
1
A
2
B
1
B
2
A B
loan
customer
borro
w
C1
C
2
L
1
L
2
C
3
L
3
L4
Example: A loan is connected withonly onecustomerusing borrower and a customeris
connected withmorethanoneloans using borrower.
25. Many-to-Onerelationship(N– 1)
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 25
An entity in A is associated withonlyoneentityin B and an entity in B is associated with
more thanoneentities inA.
A
1
A
2
B
1
B
2
A B
loan
customer
borro
w
C1
C
2
L
1
L
2
C
3
L
3
C4
Example: A loan is connected withmorethanonecustomerusing borrower and a customer
is connected withonly oneloan using borrower.
26. Many-to-Manyrelationship(N– N)
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 26
An entity in A is associated withmorethanoneentities in B and an entity in B is associated
withmorethanoneentities in A.
Example: A customer is connected withmorethanoneloan using borrower and a loan is
connected withmorethanonecustomerusing borrower.
A
1
A
2
B
1
B
2
A B
loan
customer
borro
w
C1
C
2
L
1
L
2
C
3
L
3
C
4
L
4
27. MappingCardinality(CardinalityConstraints)[Exercise]
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 27
Draw an E-R diagram and specify which type of mapping cardinality will be there in
the following examples:
Each customer has only one account in the bank and each account is held by only one customer.
[single account]
Each customer has only one account in the bank but an account can be held by more than one
customer. [joint account]
A customer may have more than one account in the bank but each account is held by only one
customer. [multiple accounts]
A customer may have more than one account in the bank and each account is held by more than
one customer. [join account as well as multiple accounts]
A student can work in more than one project and a project can be done by more than onestudent.
A student can issue more than one book but a book is issued to only onestudent.
A subject is taught by more than one faculty and a faculty can teach more than one subject.
29. • every entity in the entity set participates in at
least one relationship in the relationship set.
• indicated by double line
• some entities in the entity set may not
participate in any relationship in the
relationship set.
• indicated by single line
It specifies the participation of an entityset in a relationship
set.
There are two types participation constraints
Total participation
Partial participation
Partial participation Total participation
ParticipationConstraints
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
customer loan
borro
w
C
1
C
2
L
1
L
2
C
3
Each customer
has maximum
one loan
29
31. WeakEntitySet
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
loan payment
loan-
no
amoun
t
payment-
no
An entityset thatdoes nothavea primarykeyis called weak entity
set.
Payment-date
L_
P
Payment-
amount
Strong
Entity
Set
Weak
Entity
Set
Weak
Entity
Relationsh
ip
• Weak entity set is indicated by double rectangle.
• Weak entity relationship set is indicated by double
diamond.
31
32. WeakEntitySet
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
32
The existence of a weakentityset depends on the existence of a strong entityset.
The discriminator (partial key) of a weak entity set is the set of attributes that
distinguishes all theentities of a weak entity set.
The primary key of a weak entity set is created by combining the primary key of the strong
entity set on which the weak entity set is existence dependent and the weak entity set’s
discriminator.
We underline the discriminator attribute of a weak entity set with a dashed line.
Payment entity has payment-no which is discriminator.
Loan entity has loan-no as primary key.
So primary key for payment is (loan-no, payment-no).
34. Superclassv/sSubclass
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
Super Class Sub Class
A superclass is an entity from which
another entities can bederived.
A subclass is an entity that is derived
from anotherentity.
E.g,
an entity account has two
subsets saving_account and
current_account So an account
is superclass.
E.g,
saving_account and current_account
entities are derived from entity
account.
So saving_account andcurrent_accountare
subclass.
Account
Saving_Account
Current_Accou
nt
Super
Class
Sub
Class
34
36. Generalizationv/sSpecialization
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 36
Bottom-up
approach
Generalization Specialization
It extracts thecommonfeatures of multiple
entities to forma newentity.
It splits anentitytoform multiple newentities
that inheritsome featureof thesplitting entity.
Name Address
Person
Name Name
Address
ISA
Address
Student Faculty
SPI Salary
Name Address
SPI Salary
Person
ISA
Student Faculty
SPI Salary
37. Generalizationv/sSpecialization
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 37
Generalization Specialization
The process of creationof group from
various entities is called generalization.
The process of creationof sub-groups
within anentityis called specialization.
It is Bottom-upapproach. It is T
op-downapproach.
The process of taking the union of two or
more lower level entity sets to produce a
higher level entity set.
The process of taking a sub set of higher
level entityset to form a lower level entity
set.
It starts from the number of entity sets
and creates high level entity set using
some common features.
It starts from a single entity set and
creates different low level entity sets
using some different features.
39. Exercise
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 39
Give the examples of Generalization/Specialization in the following E-R
diagram:
Hospital Management System.
College Management System.
Bank Management System.
Insurance Company.
42. DisjointConstraint
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 42
It describes relationship betweenmembers of thesuperclass andsubclass and indicates
whether member of a superclass can be a member of one, or more than one
subclass.
Types of disjoint constraints
Disjoint Constraint
Non-disjoint (Overlapping) Constraint
43. DisjointConstraint
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 43
It specifies that the entityof a super class can belong to onlyonelower-levelentityset (sub
class).
Specified by ‘d’ or by writing disjoint near to the ISA
triangle. Cricketer
(Super
class)
Batsman
(Sub
class)
Bowler
(Sub
class)
All the players are associated with only one sub class either (Batsman or
Bowler).
Employee
(Super class)
Full-time
(Sub class)
Part-time
(Sub class)
IS
A
Disjoin
t
44. Non-disjoint(Overlapping)Constraint
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 44
It specifies that an entityof a super class can belong to morethanonelower-levelentityset
(sub class).
Specified by ‘o’ or by writing overlapping near to the ISA
triangle. Cricketer
(Super
class)
Batsman
(Sub
class)
Bowler
(Sub
class)
One player (Yuvraj singh) is associated with more than one sub
class.
Employee
(Super class)
Faculty
(Sub class)
Head
(Sub class)
IS
A
Non-
disjoint
46. Participation(Completeness)Constraint
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 46
It determines whethereverymemberof super class must participateas a memberof
subclass ornot.
Types of participation (Completeness) Constraint
Total (Mandatory) participation
Partial (Optional) participation
47. Total(Mandatory)Participation
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 47
Total participation specifies that everyentityin thesuperclass must bea memberof some
subclass in the specialization.
Specified by a double line in E-R
diagram.
Cricketer
(Super
class)
Batsman
(Sub
class)
Bowler
(Sub
class)
All the players are associated with minimum one sub class either (Batsman or
Bowler).
Employee
(Super class)
Professor
(Sub class)
Head
(Sub class)
IS
A
48. Partial(Optional)Participation
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 48
Partial participation specifies that everyentityin thesuper class does notbelong to anyof
the subclass of specialization.
Specified by a single line in E-R
diagram.
Cricketer
(Super
class)
Batsman
(Sub
class)
Bowler
(Sub
class)
Employee
(Super class)
Professor
(Sub class)
Head
(Sub class)
IS
A
Not associated
with any sub
class
50. LimitationofE-Rdiagram
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
In E-R model we cannotexpress relationships betweentwo
relationships.
Relatio
n
Relatio
n
Relatio
n
Relatio
n
Entity 1 Entity 2
50
51. LimitationofE-Rdiagram
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
Employee Department
Work
s
Borro
w
Loan
Can not connect two
relationship
Borro
w
Loan
Customer
Custom
er
Company
Process of creating an entity by combining various
components of E-R diagram is called
aggregation.
51
53. E-RdiagramofHospitalManagementSystem
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
Patien
t
53
Hospit
al
Admitte
d
PatI
D
Nam
e
HosI
D
Nam
e
Ha
s
Medical
Record
MRI
D
Ha
s
Docto
r
DrI
D
Dr
Name
Report
Name
IS
A
Indoo
r
Outdo
or
IPDI
D
OPDI
D
RoomN
o
Charg
e
55. ReducetheE-Rdiagramtodatabaseschema
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 55
An entityof an ER diagram is turnedinto a table.
Each attribute(except multi-valued attribute) turns
into
a column(attribute) in the table.
Table namecan be same as entity name.
Key attribute of the entity is the primary key of the
table which is usually underlined.
It is highly recommended that every table should
start with its primary key attribute conventionally
named as TablenameID.
Person
PersonI
D
Nam
e
Addres
s
Cit
y
PhoneN
o
Person (PersonID, Name, Address,
City)
Step 1: Reduce Entities and SimpleAttributes:
56. ReducetheE-Rdiagramtodatabaseschema
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 56
Multi-value attribute is turned into a newtable.
Add the primary key column into multi-value
attribute’stable.
Add the primary key column of the parent entity’s
table as a foreign key within the new (multi-value
attribute’s)table.
Then make a 1:N relationship between the Person
table and PhoneNo table.
Step 2: Reduce Multi-valuedAttributes:
Person
P
ersonID
PhoneN
o
Havin
g
PhoneNo (T2)
Person
(T1)
PhoneNo (PhoneID, PersonID,
PhoneNo)
Foreign Key
57. ReducetheE-Rdiagramtodatabaseschema
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 57
Convert bothentities in to tablewith proper
attribute.
Placethe primary key of any one table in to
the
anothertable as a foreign key.
Place the primary key of the Wife table WifeID in
the table Persons as Foreign key.
OR
Place the primary key of the Person table
PersonID in the table Wife as Foreign key.
Step 3: Reduce 1:1Mapping Cardinality:
Wife
WifeI
D
WNam
e
Person
PersonID
PNam
e
Havin
g
Person (PersonID,
PName)
Wife (WifeID, Wname,
PersonID)
Wife (WifeID, Wname)
Person (
P ersonID, Pname,
WifeID)
58. ReducetheE-Rdiagramtodatabaseschema
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 58
Convert bothentities in to tablewith proper
attribute.
Place the primary key of table having 1 mapping in
to the another table having many cardinality as a
Foreign key.
Place the primary key of the Person table
PersonID in the table House as Foreign key.
Step 4: Reduce 1:NMapping Cardinality:
House
HouseI
D
HNam
e
Person
Havin
g
PersonID PName
Person (PersonID, PName)
House (HouseID, Hname,
PersonID)
59. ReducetheE-Rdiagramtodatabaseschema
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 59
Convert both entities in to tablewith proper
attribute.
Create a separate tableforrelationship.
Place the primarykeyof bothentities table into the
relationship’s tableas foreignkey.
Place the primary key of the Customer table CID
and Account table Ano in the table Has_Acct as
Foreign key.
Step 5: Reduce N:N MappingCardinality:
Account
ActN
o
Balanc
e
Customer
Has_Ac
ct
CID CName
Customer ( CID,
CName) Account (
A
ctNo, Balance)
Has_Acct (HasAcctID, CID, ActNo)
60. SummeryofSymbolsusedinE-Rdiagram
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
Customer
Entit
y
EmpID
Primary
Key
Attribute
Payment
Weak
Entity
Total
Participatio
n
Name
Attribut
e
Age
Derived
Attribut
e
Hold
Relationsh
ip
PhoneN
o
Multi
Valued
Attribute
Issue
Weak
Entity
Relationsh
ip
IS
A
Specializatio
n/
Generalizati
on
R
E
Role
Indicato
r
R
E
PymtID
Discriminatin
g Attribute
Role
Nam
e
60
61. SummeryofSymbolsusedinE-Rdiagram
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
R
One to
One
E E
One to
Many
R
E E
Many to
One
R
E E
Many to
Many
R
E E
ISA
Total
Specializatio
n/
Generalizatio
n
Disjoint
ISA
Disjoint
Specializatio
n/
Generalizatio
n
Overlappin
g
ISA
Overlapping
Specializatio
n/
Generalizatio
n
ISA
Partial
Specializatio
n/
Generalizatio
n
61
63. Whatis aDatabaseModels?
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 63
A database model is a type of data model that defines thelogical structure of a
database.
It determine how datacan bestored, accessed andupdatedin a database management
system.
The most popular example of a database model is the relational model, which uses a
table- based format.
64. TypeofDatabaseModels
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 64
Hierarchical Model
Network Model
Entity-relationship
Model Relational
Model
Object-oriented database
Model
65. HierarchicalModel
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 65
The hierarchical model organizes data into a tree-like structure,where each record has a
single parentorroot.
Department
Student Professor
The hierarchy starts from the Root data, and expands like a tree, adding child nodes to the
parentnodes.
In hierarchical model, data is organized into tree-like structure with one-to-many
relationship between two different types of data, for example, one department can have
manyprofessors and manystudents.
66. NetworkModel
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 66
This is an extensionof thehierarchical model,allowing many-to-manyrelationships in a
tree- like structure that allows multipleparents.
A
B C
D E F
67. Entity-relationshipModel
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 67
In this database model, relationships are created by dividing object of interest into entity
and
its characteristics intoattributes.
Student Book
Issu
e
RollN
o
Nam
e
Branc
h
Se
m
B
ookNo
Nam
e
Autho
r
Pric
e
Entitie
s
Attributes
Relationsh
ip
68. RelationalModel
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 68
In this model, data is organized in two-dimensionaltables and the relationship is
maintained bystoring a commonattribute.
ResID Rno SubID Marks
1 101 1 80
2 101 2 85
3 102 1 75
4 102 2 80
SubID Subject_Name Teacher
1 DBMS Doshi
2 DS Vyash
Foreign
Key
Rno Student_Name Age
101 Raj Patel 20
102 Meet Shah 21
Foreign Key
69. Object-orienteddatabaseModel
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 69
This data model is another method of representing real world objects.
It considers each objectin theworldas objects and isolates it from each other.
It groups its relatedfunctionalities togetherand allows inheriting its functionality to other
related sub-groups.
71. IntegrityConstraints
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS
71
Integrity constraints are a set of rules. It is used to maintain thequalityof information.
Integrity constraints ensure that the data insertion, updating, and other processes
have to be performed in such a way that data integrity is not affected.
Thus, integrity constraint is used to guard against accidental damage to the database.
Various Integrity Constraints are:
Check
Not null
Unique
Primary key
Foreign key
72. IntegrityConstraints
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 72
Check
This constraint defines a business rule on a column. All the rows in that column must satisfy this
rule.
Limits the data values of variables to a specific set, range,orlist ofvalues.
The constraint can be applied for a single column or a group ofcolumns.
E.g. value of SPI should be between 0 to10.
Not null
This constraint ensures all rows in the table contain a definite value for the column which is
specified as not null. Which means a null valueis not allowed.
E.g. name column should have some value.
Unique
This constraint ensures that a column or a group of columns in each row have a distinct (unique)
value.
A column(s) can have a null value but the values cannot beduplicated.
E.g. enrollmentno column should have uniquevalue.
73. IntegrityConstraints
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 73
Primary key
This constraint defines a column or combination of columns which uniquely identifies each row in
the table.
Primary key = Uniquekey+Not null
E.g. enrollmentno column should have unique value as well as can’t benull.
Foreign key (referential integrity constraint)
A referential integrity constraint (foreign key) is specified between twotables.
In the referential integrity constraints, if a foreign key column in table 1 refers to the primary key
column of table 2, then every value of the foreign key column in table 1 must be null or be
available in primary key column of table 2.
RollNo Student_Name DeptID
101 Raj Patel 1
102 Meet Shah 2
Foreign Key
DeptID Dept_Name HOD
1 Computer Doshi
2 IT Vyash
74. iQuestions
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 74
1. Write a note on mapping cardinality in E-R diagram.
2. Explain the difference between a weak and a strong entity set.
3. Explain the difference between generalization and specialization. OR Explain
specialization and generalization concept in E-R diagram with suitable example.
4. Write a note on constraints on specialization and generalization.
5. Explain aggregation in E-R diagram with example.
6. What do you mean by integrity constraints? Discuss various integrity constraints.
75. Questionsasked[E-Rdiagrams]
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 75
7. Draw E-R diagram for Bank Management System.
8. Define E-R diagram. Draw an E-R diagram for Library Management System.
Assume relevant entities and attributes for the given system.
9. Construct an E-R diagram for a car-insurance company whose customers own one
or more cars each. Each car has associated with it zero to any number of recorded
accidents.
10.Design a generalization–specialization hierarchy for a motor-vehicle sales company.
The company sells motorcycles, passenger cars, vans, and buses. Justify your
placement of attributes at each level of the hierarchy. Explain why they should not
be placed at a higher or lower level.
76. Questions[E-RdiagramsandDatabase]
Prof. Firoz ASherasiya #3130703 (DBMS) UNIT 2 – DATA MODELS 76
11.Design a database for an airline. The database must keep track of customers and
their reservations, flights and their status, seat assignments on individual flights,
and the schedule and routing of future flights. Your design should include an E-R
diagram, a set of relational schemas, and a list of constraints, including primary-key
and foreign-key constraints.
12.Design a database for a hospital with a set of patients and a set of medical doctors.
Associate with each patient a log of the various tests and examinations conducted.
Your design should include an E-R diagram, a set of relational schemas, and a list
of constraints, including primary-key and foreign-key constraints.