SlideShare a Scribd company logo
1 of 65
.
Enes BOLFİDAN
Ahmet Fahri KILIÇ
diagram
Topics
• Design Process
• Modeling
• Constraints
• E-R Diagram
• Design Issues
• Weak Entity Sets
• Extended E-R Features
DATA
unorganized
form
ex: student’s
score
Information
processed, structured and
organized data
ex: class average which can be
calculated from data.
TABLE
A table is a collection (rows) of data
on a single related topic.
Difference between table and
database
Table Database
A table is an object inside a
database
A database has tables of data,
a table is a collection (rows) of data
on a single related topic.
A database can have 10 or
thousands of tables
Ex: employee table
Contains only employees detail. But
it not contains inventory detail.
But DB is a collection of Employee
table as well as inventory table.
Sample Table
Sample Database DB is a
collection
related
tables
Why we need ER diagram
giving you image of how the tables
should connect
 what fields are going to be on each
table
the tables connection, if many-to-
many, one-to-many.
“ER diagrams are easy for non-technical
people to understand, and thus are
typically used by database designers
before the schema ever exists”
Entity
• An entity can be defined as anything, which can be
uniquely identified and about which data is stored in a
database.
• Entity: Real-world object distinguishable from other
objects. An entity is described using a set of attributes.
Employees
ssn
name
email
Examples of entities
– Person: EMPLOYEE, STUDENT, PATIENT
– Place: STORE, WAREHOUSE
– Object: MACHINE, PRODUCT, CAR
– Concept: ACCOUNT, COURSE
Entity Relationship(ER) Modelling
• In 1976, Peter Chen first proposed modeling databases
using a graphical technique that humans can relate
easily.
• An Entity–Relationship (ER) model is an abstract or
conceptual way of describing a database
• The goal of E-R Modelling is to produce a model of
data that is non-technical and free of ambiguities
Entity set
• Entity Set: A collection of similar entities.
E.g., all employees.
– All entities in an entity set have the same set of
attributes.
Person, place, object, event or
concept about which data is to
be maintained
named property or
characteristic of an
entity
Association between
the instances of one
or more entity types
EntityName Verb Phrase AttributeName
Example
RELATIONSHIP
• Relationship: Association among two or
more entities. e.g., rose works in Pharmacy
department.
• Relationship Set: Collection of similar
relationships.
• Same entity set could participate in different
relationship sets, or in different “roles” in same set.
Relationship Example
 Associations between instances of one or more entity types that is of
interest
 Buying is the relationship between Vendor and Customer.
Author Book
Relationship name:
writes
An author writes one or more books
A book can be written by one or more authors.
ER Diagram Notation
Represents an entity set
Represents an attribute
Represent linking of attributes to entity sets
and of entity sets to relationship sets.
Represents a relationship
Draw ER Diagram in MS-Visio
Degree of Relationships
• Degree: number of entity types that participate in a relationship
• Three cases
– Unary: between two instances of one entity type
– Binary: between the instances of two entity types
• Ternary: among the instances of three entity types
Attributes
• Example of entity types and associated attributes:
STUDENT: Student_ID, Student_Name, Home_Address, Phone_Number,
Major
Attribute types
1.Single-valued attribute
2.Multi-valued attribute
3.Simple Attribute
4.Composite Attribute
5.Key Attribute
6.Derived Attribute
1. Single-valued attribute : Attribute that holds a single value for an
occurrence of an entity type. E.g. age, first_name, last_name, full_name,
etc.
2 Multi-valued attribute :Attribute where there might be more than one
value for a given occurrence of an entity type.
Full Name
Age
Phone
number
Student
3. Simple Attribute: It is composed of a single component e.g. age,
first_name, last_name, etc. But full_name is not simple attribute.
Because it is composed of first_name and last_name.
4. Composite Attribute: It is composed of more than one component.
5. Key Attribute:
• Primary Key is a key attribute.
• At most one attribute in each entity
6. Derived Attribute : The value of the derived attribute can be derived
from the values of other related attributes. Age of a person can be
derived from the date of birth and current date.
i.e. age = current date –date of birth. In this example, age is the derived
attribute.
Multiplicity
Mapping Cardinality Constraints
• Express the number of entities to which another
entity can be associated via a relationship set.
• Most useful in describing binary relationship sets.
• 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
Mapping Cardinalities
One to one One to many
Note: Some elements in A and B may not be mapped to any
elements in the other set
Mapping Cardinalities
Many to one Many to many
Note: Some elements in A and B may not be mapped to any
elements in the other set
KEY
• Key and key attributes:
– Key: a unique value for an entity
– Key attributes: a group of one or more attributes that uniquely
identify an entity in the entity set
• Super key, candidate key, and primary key
– Super key: a set of attributes that allows to identify and entity
uniquely in the entity set
– Candidate key: minimal super key
• There can be many candidate keys
– Primary key: a candidate key chosen by the designer
• Denoted by underlining in ER attributes.
Key Constraints
• Consider Works_In: An employee can work in many
departments; a dept can have many employees.
• In contrast, each dept has at most one manager,
according to the key constraint on Manages.
Weak Entity Sets
• An entity set that does not have a primary key is
referred to as a weak entity set.
• The existence of a weak entity set depends on
the existence of a identifying entity set
– it must relate to the identifying entity set
via a total, one-to-many relationship set
from the identifying to the weak entity set
– Identifying relationship depicted using a
double diamond
• In a relational database, a Weak Entity is an entity that cannot be
uniquely identified by its attributes alone; therefore, it must use
a foreign key in conjunction with its attributes to create a primary
key. The foreign key is typically a primary key of an entity it is
related to.
• Strong entity and Weak entity : Weak entity is an entity that
depends on another entity. Weak entity doesn't have key attribute
of their own.
Entity-Relationship (ER) Diagram
• ER Modeling is a “top-down” approach to database
design.
• Entity Relationship (ER) Diagram
– A detailed, “logical representation” of the entities,
associations and data elements for an organization or
business
Notation uses three main constructs
– Data entities
– Relationships
– Attributes
E-R Diagrams
 Rectangles represent entity sets.
 Diamonds represent relationship sets.
 Lines link attributes to entity sets and entity sets to relationship sets.
 Ellipses represent attributes
 Double ellipses represent multivalued attributes.
 Dashed ellipses denote derived attributes.
 Underline indicates primary key attributes (will study later)
E-R Diagram With Composite, Multivalued, and Derived
Attributes
Relationship Sets with Attributes
Roles
• Entity sets of a relationship need not be distinct
• The labels “manager” and “worker” are called roles; they
specify how employee entities interact via the works_for
relationship set.
• Roles are indicated in E-R diagrams by labeling the lines that
connect diamonds to rectangles.
• Role labels are optional, and are used to clarify semantics of the
relationship
Cardinality and Connectivity
• Relationships can be classified as either
• one – to – one
• one – to – many
• many – to –many
• Cardinality : minimum and maximum number of
instances of Entity B that can (or must be) associated
with each instance of entity A.
Connectivity
Cardinality Constraints
• We express cardinality constraints by drawing
either a directed line (), signifying “one,” or
an undirected line (—), signifying “many,”
between the relationship set and the entity
set.
• One-to-one relationship:
– A customer is associated with at most one loan via
the relationship borrower
– A loan is associated with at most one customer via
borrower
One-To-Many Relationship
• In the one-to-many relationship a loan is
associated with at most one customer via
borrower, a customer is associated with
several (including 0) loans via borrower
Many-To-One Relationships
• In a many-to-one relationship a loan is
associated with several (including 0)
customers via borrower, a customer is
associated with at most one loan via borrower
Many-To-Many Relationship
• A customer is associated with several (possibly
0) loans via borrower
• A loan is associated with several (possibly 0)
customers via borrower
Connectivity
• Chen Model
– 1 to represent one.
– M to represent many
• Crow’s Foot
many
One
One or many
1
M
Mandatory one , means (1,1)
Binary Relationships
• 1:M relationship
– Relational modeling ideal
– Should be the norm in any relational database design
The 1: M relationship between PAINTER and PAINTING
Binary Relationships
• 1:1 relationship
– Should be rare in any relational database design
– A single entity instance in one entity class is
related to a single entity instance in another
entity class
– Could indicate that two entities actually belong
in the same table
The 1:1 Relationship Between PROFESSOR and DEPARTMENT
Binary Relationships
• M:N relationships
– Must be avoided because they lead to data redundancies.
– Can be implemented by breaking it up to produce a set of 1:M
relationships
– Can avoid problems inherent to M:N relationship by creating a
composite entity or bridge entity
• This will be used to link the tables that were originally
related in a M:N relationship
• The composite entity structure includes-as foreign keys-at
least the primary keys of the tables that are to be linked.
The M:N Relationship Between STUDENT and CLASS
This CANNOT be implemented as shown next…..
Bowser
Smithson
Accounting 1 (ACCT-211)
Intro to Microcomputing (CIS-220)
Intro to Statistics (QM-261)
Changing the M:N relationship to TWO 1:M relationships
Extended E-R
• Specialization
• Generalization
• Aggregation
Specialization
• Top-down design process: we designate sub
groupings within an entity set that are
distinctive from other entities in the set.
• These sub groupings become lower-level entity
sets that have attributes or participate in
relationships that do not apply to the higher-
level entity set.
• Depicted by a “triangle component labeled ISA”
• Attribute inheritance – a lower-level entity set
inherits all the attributes and relationship
participation of the higher-level entity set to
which it is linked.
Specialization Example
Generalization
• A bottom-up design process – combine a number of entity
sets that share the same features into a higher-level entity
set.
• Specialization and generalization are simple inversions of
each other; they are represented in an E-R diagram in the
same way.
• The terms specialization and generalization are used
interchangeably.
Specialization and Generalization
(Cont.)
• Can have multiple specializations of an entity
set based on different features.
• E.g. permanent_employee vs.
temporary_employee, in addition to officer vs.
secretary vs. teller
• Each particular employee would be
– a member of one of permanent_employee or
temporary_employee,
– and also a member of one of officer, secretary, or
teller
• The ISA relationship also referred to as
“superclass – subclass” relationship
Design Constraints on a
Specialization/Generalization
• Constraint on which entities can be members of a
given lower-level entity set.
– Condition-defined : evaluated by an explicit condition or
predicate.
– User-defined : database user assigns
• Constraint on whether or not entities may belong to
more than one lower-level entity set within a single
generalization.
– Disjoint
• An entity can belong to only one lower-level entity set
• Noted in E-R diagram by writing disjoint next to the ISA triangle
– Overlapping
• an entity can belong to more than one lower-level entity set
Design Constraints on a
Specialization/Generalization (Contd.)
• Completeness constraint
– Total : an entity must belong to one of the
lower-level entity sets
– Partial : an entity need not belong to one of the
lower-level entity sets
Aggregation
 Consider the ternary relationship works-on, which we saw earlier
 Suppose we want to record managers for tasks performed by an
employee at a branch
Aggregation (Cont.)
• Relationship sets works_on and manages represent
overlapping information
– Every manages relationship corresponds to a works_on
relationship
– However, some works_on relationships may not correspond to
any manages relationships
• So we can’t discard the works_on relationship
• Eliminate this redundancy via aggregation
– Treat relationship as an abstract entity
– Allows relationships between relationships
– Abstraction of relationship into new entity
• Without introducing redundancy, the following diagram
represents:
– An employee works on a particular job at a particular branch
– An employee, branch, job combination may have an associated
manager
Aggregation (Cont.)
• Relationship sets works-on and manages
represent overlapping information
– Every manages relationship corresponds to a works-
on relationship
– However, some works-on relationships may not
correspond to any manages relationships  we
can’t discard the works-on relationship
• Redundancy problem  aggregation
E-R Diagram With Aggregation
Summary of Symbols Used in E-R
Notation
Summary of Symbols (Cont.)
Alternative E-R Notations
References
http://www.smartdraw.com/resources/tutorials/entity-relationship-
diagrams/
http://www.tutorialspoint.com/dbms/er_diagram_representation.htm
http://www-db.in.tum.de/~grust/teaching/ss06/DBfA/db1-04.pdf
http://s3.amazonaws.com/ppt-download/entity-relationship-diagram2
http://www.cse.unt.edu/~huangyan/5350/Slides/ER.ppt
http://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model
http://databases.about.com/cs/specificproducts/g/er.htm

More Related Content

What's hot

2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMSkoolkampus
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelNeil Neelesh
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship modelyash patel
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship ModellingBhandari Nawaraj
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramRakhi Mukherji
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER ModelAjay Chhimpa
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramShakila Mahjabin
 
03 Ch3 Notes Revised
03 Ch3 Notes Revised03 Ch3 Notes Revised
03 Ch3 Notes Revisedguest6f408c
 
Database Systems - Entity Relationship Modeling (Chapter 4/2)
Database Systems - Entity Relationship Modeling (Chapter 4/2)Database Systems - Entity Relationship Modeling (Chapter 4/2)
Database Systems - Entity Relationship Modeling (Chapter 4/2)Vidyasagar Mundroy
 
Schema relationship to E-R diagram
Schema relationship to E-R diagramSchema relationship to E-R diagram
Schema relationship to E-R diagramBadrul Alam
 

What's hot (19)

2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
Unit02 dbms
Unit02 dbmsUnit02 dbms
Unit02 dbms
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
Erd
ErdErd
Erd
 
E R Diagram
E R DiagramE R Diagram
E R Diagram
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
DBMS Class 3
DBMS Class 3DBMS Class 3
DBMS Class 3
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER Model
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
enhanced er diagram
enhanced er diagramenhanced er diagram
enhanced er diagram
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Er diagram
Er diagramEr diagram
Er diagram
 
03 Ch3 Notes Revised
03 Ch3 Notes Revised03 Ch3 Notes Revised
03 Ch3 Notes Revised
 
Database Systems - Entity Relationship Modeling (Chapter 4/2)
Database Systems - Entity Relationship Modeling (Chapter 4/2)Database Systems - Entity Relationship Modeling (Chapter 4/2)
Database Systems - Entity Relationship Modeling (Chapter 4/2)
 
Schema relationship to E-R diagram
Schema relationship to E-R diagramSchema relationship to E-R diagram
Schema relationship to E-R diagram
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
 

Similar to ER Diagram for Student Data

Similar to ER Diagram for Student Data (20)

entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
 
10287 lecture5(2)
10287 lecture5(2)10287 lecture5(2)
10287 lecture5(2)
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
Database design
Database designDatabase design
Database design
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
Conceptual Modeling of Data
Conceptual Modeling of DataConceptual Modeling of Data
Conceptual Modeling of Data
 
Database part3-
Database part3-Database part3-
Database part3-
 
ER-Diagram.pptx
ER-Diagram.pptxER-Diagram.pptx
ER-Diagram.pptx
 
ER MODEL.pptx
ER MODEL.pptxER MODEL.pptx
ER MODEL.pptx
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
lecture2.pdf
lecture2.pdflecture2.pdf
lecture2.pdf
 
Er model
Er modelEr model
Er model
 
Presentation of saad on e-r diagram.
Presentation of saad on e-r diagram.Presentation of saad on e-r diagram.
Presentation of saad on e-r diagram.
 
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptxEntity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
 

More from Enes Bolfidan

Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceEnes Bolfidan
 
Advanced public finance in turkey
Advanced public finance in turkeyAdvanced public finance in turkey
Advanced public finance in turkeyEnes Bolfidan
 
Case study-IT Outsourcing in Denmark
Case study-IT Outsourcing in DenmarkCase study-IT Outsourcing in Denmark
Case study-IT Outsourcing in DenmarkEnes Bolfidan
 
Turkish consumer’ s behaviour
Turkish consumer’ s behaviourTurkish consumer’ s behaviour
Turkish consumer’ s behaviourEnes Bolfidan
 
Outsourcing core computency- downsizing
Outsourcing core computency- downsizingOutsourcing core computency- downsizing
Outsourcing core computency- downsizingEnes Bolfidan
 
Informati̇on technology 1
Informati̇on technology 1Informati̇on technology 1
Informati̇on technology 1Enes Bolfidan
 
Information technology
Information technologyInformation technology
Information technologyEnes Bolfidan
 
Coca cola case study
Coca cola case studyCoca cola case study
Coca cola case studyEnes Bolfidan
 
Vertical and horizontal integration
Vertical and horizontal integrationVertical and horizontal integration
Vertical and horizontal integrationEnes Bolfidan
 
Public administration
Public administrationPublic administration
Public administrationEnes Bolfidan
 

More from Enes Bolfidan (12)

Shell - Strategy
Shell - StrategyShell - Strategy
Shell - Strategy
 
Electricity storage
Electricity storageElectricity storage
Electricity storage
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Advanced public finance in turkey
Advanced public finance in turkeyAdvanced public finance in turkey
Advanced public finance in turkey
 
Case study-IT Outsourcing in Denmark
Case study-IT Outsourcing in DenmarkCase study-IT Outsourcing in Denmark
Case study-IT Outsourcing in Denmark
 
Turkish consumer’ s behaviour
Turkish consumer’ s behaviourTurkish consumer’ s behaviour
Turkish consumer’ s behaviour
 
Outsourcing core computency- downsizing
Outsourcing core computency- downsizingOutsourcing core computency- downsizing
Outsourcing core computency- downsizing
 
Informati̇on technology 1
Informati̇on technology 1Informati̇on technology 1
Informati̇on technology 1
 
Information technology
Information technologyInformation technology
Information technology
 
Coca cola case study
Coca cola case studyCoca cola case study
Coca cola case study
 
Vertical and horizontal integration
Vertical and horizontal integrationVertical and horizontal integration
Vertical and horizontal integration
 
Public administration
Public administrationPublic administration
Public administration
 

Recently uploaded

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Recently uploaded (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

ER Diagram for Student Data

  • 2. Topics • Design Process • Modeling • Constraints • E-R Diagram • Design Issues • Weak Entity Sets • Extended E-R Features
  • 4. Information processed, structured and organized data ex: class average which can be calculated from data.
  • 5. TABLE A table is a collection (rows) of data on a single related topic.
  • 6. Difference between table and database Table Database A table is an object inside a database A database has tables of data, a table is a collection (rows) of data on a single related topic. A database can have 10 or thousands of tables Ex: employee table Contains only employees detail. But it not contains inventory detail. But DB is a collection of Employee table as well as inventory table.
  • 8. Sample Database DB is a collection related tables
  • 9. Why we need ER diagram giving you image of how the tables should connect  what fields are going to be on each table the tables connection, if many-to- many, one-to-many. “ER diagrams are easy for non-technical people to understand, and thus are typically used by database designers before the schema ever exists”
  • 10. Entity • An entity can be defined as anything, which can be uniquely identified and about which data is stored in a database. • Entity: Real-world object distinguishable from other objects. An entity is described using a set of attributes. Employees ssn name email
  • 11. Examples of entities – Person: EMPLOYEE, STUDENT, PATIENT – Place: STORE, WAREHOUSE – Object: MACHINE, PRODUCT, CAR – Concept: ACCOUNT, COURSE
  • 12. Entity Relationship(ER) Modelling • In 1976, Peter Chen first proposed modeling databases using a graphical technique that humans can relate easily. • An Entity–Relationship (ER) model is an abstract or conceptual way of describing a database • The goal of E-R Modelling is to produce a model of data that is non-technical and free of ambiguities
  • 13. Entity set • Entity Set: A collection of similar entities. E.g., all employees. – All entities in an entity set have the same set of attributes.
  • 14. Person, place, object, event or concept about which data is to be maintained named property or characteristic of an entity Association between the instances of one or more entity types EntityName Verb Phrase AttributeName Example
  • 15. RELATIONSHIP • Relationship: Association among two or more entities. e.g., rose works in Pharmacy department. • Relationship Set: Collection of similar relationships. • Same entity set could participate in different relationship sets, or in different “roles” in same set.
  • 16. Relationship Example  Associations between instances of one or more entity types that is of interest  Buying is the relationship between Vendor and Customer. Author Book Relationship name: writes An author writes one or more books A book can be written by one or more authors.
  • 17. ER Diagram Notation Represents an entity set Represents an attribute Represent linking of attributes to entity sets and of entity sets to relationship sets. Represents a relationship
  • 18. Draw ER Diagram in MS-Visio
  • 19. Degree of Relationships • Degree: number of entity types that participate in a relationship • Three cases – Unary: between two instances of one entity type – Binary: between the instances of two entity types
  • 20. • Ternary: among the instances of three entity types
  • 21. Attributes • Example of entity types and associated attributes: STUDENT: Student_ID, Student_Name, Home_Address, Phone_Number, Major
  • 22. Attribute types 1.Single-valued attribute 2.Multi-valued attribute 3.Simple Attribute 4.Composite Attribute 5.Key Attribute 6.Derived Attribute
  • 23. 1. Single-valued attribute : Attribute that holds a single value for an occurrence of an entity type. E.g. age, first_name, last_name, full_name, etc. 2 Multi-valued attribute :Attribute where there might be more than one value for a given occurrence of an entity type. Full Name Age Phone number Student
  • 24. 3. Simple Attribute: It is composed of a single component e.g. age, first_name, last_name, etc. But full_name is not simple attribute. Because it is composed of first_name and last_name. 4. Composite Attribute: It is composed of more than one component. 5. Key Attribute: • Primary Key is a key attribute. • At most one attribute in each entity
  • 25. 6. Derived Attribute : The value of the derived attribute can be derived from the values of other related attributes. Age of a person can be derived from the date of birth and current date. i.e. age = current date –date of birth. In this example, age is the derived attribute.
  • 27. Mapping Cardinality Constraints • Express the number of entities to which another entity can be associated via a relationship set. • Most useful in describing binary relationship sets. • 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
  • 28. Mapping Cardinalities One to one One to many Note: Some elements in A and B may not be mapped to any elements in the other set
  • 29. Mapping Cardinalities Many to one Many to many Note: Some elements in A and B may not be mapped to any elements in the other set
  • 30. KEY • Key and key attributes: – Key: a unique value for an entity – Key attributes: a group of one or more attributes that uniquely identify an entity in the entity set • Super key, candidate key, and primary key – Super key: a set of attributes that allows to identify and entity uniquely in the entity set – Candidate key: minimal super key • There can be many candidate keys – Primary key: a candidate key chosen by the designer • Denoted by underlining in ER attributes.
  • 31. Key Constraints • Consider Works_In: An employee can work in many departments; a dept can have many employees. • In contrast, each dept has at most one manager, according to the key constraint on Manages.
  • 32. Weak Entity Sets • An entity set that does not have a primary key is referred to as a weak entity set. • The existence of a weak entity set depends on the existence of a identifying entity set – it must relate to the identifying entity set via a total, one-to-many relationship set from the identifying to the weak entity set – Identifying relationship depicted using a double diamond
  • 33. • In a relational database, a Weak Entity is an entity that cannot be uniquely identified by its attributes alone; therefore, it must use a foreign key in conjunction with its attributes to create a primary key. The foreign key is typically a primary key of an entity it is related to. • Strong entity and Weak entity : Weak entity is an entity that depends on another entity. Weak entity doesn't have key attribute of their own.
  • 34. Entity-Relationship (ER) Diagram • ER Modeling is a “top-down” approach to database design. • Entity Relationship (ER) Diagram – A detailed, “logical representation” of the entities, associations and data elements for an organization or business Notation uses three main constructs – Data entities – Relationships – Attributes
  • 35. E-R Diagrams  Rectangles represent entity sets.  Diamonds represent relationship sets.  Lines link attributes to entity sets and entity sets to relationship sets.  Ellipses represent attributes  Double ellipses represent multivalued attributes.  Dashed ellipses denote derived attributes.  Underline indicates primary key attributes (will study later)
  • 36. E-R Diagram With Composite, Multivalued, and Derived Attributes
  • 38. Roles • Entity sets of a relationship need not be distinct • The labels “manager” and “worker” are called roles; they specify how employee entities interact via the works_for relationship set. • Roles are indicated in E-R diagrams by labeling the lines that connect diamonds to rectangles. • Role labels are optional, and are used to clarify semantics of the relationship
  • 39. Cardinality and Connectivity • Relationships can be classified as either • one – to – one • one – to – many • many – to –many • Cardinality : minimum and maximum number of instances of Entity B that can (or must be) associated with each instance of entity A. Connectivity
  • 40. Cardinality Constraints • We express cardinality constraints by drawing either a directed line (), signifying “one,” or an undirected line (—), signifying “many,” between the relationship set and the entity set. • One-to-one relationship: – A customer is associated with at most one loan via the relationship borrower – A loan is associated with at most one customer via borrower
  • 41. One-To-Many Relationship • In the one-to-many relationship a loan is associated with at most one customer via borrower, a customer is associated with several (including 0) loans via borrower
  • 42. Many-To-One Relationships • In a many-to-one relationship a loan is associated with several (including 0) customers via borrower, a customer is associated with at most one loan via borrower
  • 43. Many-To-Many Relationship • A customer is associated with several (possibly 0) loans via borrower • A loan is associated with several (possibly 0) customers via borrower
  • 44. Connectivity • Chen Model – 1 to represent one. – M to represent many • Crow’s Foot many One One or many 1 M Mandatory one , means (1,1)
  • 45. Binary Relationships • 1:M relationship – Relational modeling ideal – Should be the norm in any relational database design The 1: M relationship between PAINTER and PAINTING
  • 46. Binary Relationships • 1:1 relationship – Should be rare in any relational database design – A single entity instance in one entity class is related to a single entity instance in another entity class – Could indicate that two entities actually belong in the same table
  • 47. The 1:1 Relationship Between PROFESSOR and DEPARTMENT
  • 48. Binary Relationships • M:N relationships – Must be avoided because they lead to data redundancies. – Can be implemented by breaking it up to produce a set of 1:M relationships – Can avoid problems inherent to M:N relationship by creating a composite entity or bridge entity • This will be used to link the tables that were originally related in a M:N relationship • The composite entity structure includes-as foreign keys-at least the primary keys of the tables that are to be linked.
  • 49. The M:N Relationship Between STUDENT and CLASS This CANNOT be implemented as shown next….. Bowser Smithson Accounting 1 (ACCT-211) Intro to Microcomputing (CIS-220) Intro to Statistics (QM-261)
  • 50. Changing the M:N relationship to TWO 1:M relationships
  • 51. Extended E-R • Specialization • Generalization • Aggregation
  • 52. Specialization • Top-down design process: we designate sub groupings within an entity set that are distinctive from other entities in the set. • These sub groupings become lower-level entity sets that have attributes or participate in relationships that do not apply to the higher- level entity set. • Depicted by a “triangle component labeled ISA” • Attribute inheritance – a lower-level entity set inherits all the attributes and relationship participation of the higher-level entity set to which it is linked.
  • 54. Generalization • A bottom-up design process – combine a number of entity sets that share the same features into a higher-level entity set. • Specialization and generalization are simple inversions of each other; they are represented in an E-R diagram in the same way. • The terms specialization and generalization are used interchangeably.
  • 55. Specialization and Generalization (Cont.) • Can have multiple specializations of an entity set based on different features. • E.g. permanent_employee vs. temporary_employee, in addition to officer vs. secretary vs. teller • Each particular employee would be – a member of one of permanent_employee or temporary_employee, – and also a member of one of officer, secretary, or teller • The ISA relationship also referred to as “superclass – subclass” relationship
  • 56. Design Constraints on a Specialization/Generalization • Constraint on which entities can be members of a given lower-level entity set. – Condition-defined : evaluated by an explicit condition or predicate. – User-defined : database user assigns • Constraint on whether or not entities may belong to more than one lower-level entity set within a single generalization. – Disjoint • An entity can belong to only one lower-level entity set • Noted in E-R diagram by writing disjoint next to the ISA triangle – Overlapping • an entity can belong to more than one lower-level entity set
  • 57. Design Constraints on a Specialization/Generalization (Contd.) • Completeness constraint – Total : an entity must belong to one of the lower-level entity sets – Partial : an entity need not belong to one of the lower-level entity sets
  • 58. Aggregation  Consider the ternary relationship works-on, which we saw earlier  Suppose we want to record managers for tasks performed by an employee at a branch
  • 59. Aggregation (Cont.) • Relationship sets works_on and manages represent overlapping information – Every manages relationship corresponds to a works_on relationship – However, some works_on relationships may not correspond to any manages relationships • So we can’t discard the works_on relationship • Eliminate this redundancy via aggregation – Treat relationship as an abstract entity – Allows relationships between relationships – Abstraction of relationship into new entity • Without introducing redundancy, the following diagram represents: – An employee works on a particular job at a particular branch – An employee, branch, job combination may have an associated manager
  • 60. Aggregation (Cont.) • Relationship sets works-on and manages represent overlapping information – Every manages relationship corresponds to a works- on relationship – However, some works-on relationships may not correspond to any manages relationships  we can’t discard the works-on relationship • Redundancy problem  aggregation
  • 61. E-R Diagram With Aggregation
  • 62. Summary of Symbols Used in E-R Notation