SlideShare a Scribd company logo
 Entity/Relationship models
 Entities
 Relationships
 Attributes
 E/R Diagrams
 For more information
 Connolly and Begg chapter no: 11
 Before we look at how to
create and use a database
we’ll look at how to design
one
 Conceptual design
 Build a model independent
of the choice of DBMS
 Logical design
 Create the database in a
given DBMS
 Physical design
 How the database is stored
in hardware
 E/R Modelling is used for
conceptual design
Consists of:
 Entities - objects or items of
interest
 Attributes - facts about, or
properties of, an entity
 Relationships - links
between entities
 Example
 In a University database we
might have entities for
Students, Subjects and
Lecturers. Students might
have attributes such as
their ID, Name, and Course,
and could have
relationships with Subjects
(enrolment) and Lecturers
 E/R Models are often represented as E/R diagrams that
 Entity Relationship Model
 E-R model is a detailed, logical representation of data for an organization.
 It is the graphical representation of data models in the form of entity-
relationship diagram
 In an E/R Diagram, an
entity is usually drawn as a
box with rounded corners
 The box is labelled with the
name of the class of
objects represented by
that entity
Student
Lecturer
Module
Tutors
Studies
ID
CourseName
 In an E/R Diagram
attributes may be drawn as
ovals
 Each attribute is linked to
its entity by a line
 The name of the attribute
is written in the oval
Student
Lecturer
Module
Tutors
Studies
ID
CourseName
 Relationships are an
association between two or
more entities
 Each Student takes several
Modules
 Each Module is taught by a
Lecturer
 Each Employee works for a
single Department
 Relationships have
 A name
 A set of entities that
participate in them
 A degree - the number of
entities that participate
(most have degree 2)
 Each entity in a
relationship can
participate in zero, one, or
more than one instances
of that relationship
 This leads to 3 types of
relationship…
 One to one (1:1)
 Each lecturer has a unique
office
 One to many (1:M)
 A lecturer may tutor many
students, but each student has
just one tutor
 Many to many (M:M)
 Each student takes several
modules, and each module is
taken by several students
 Relationships are links
between two entities
 The name is given in a
diamond box
 The ends of the link show
cardinality Student
Lecturer
Module
Tutors
Studies
ID
CourseName
ManyOne
 Many to many
relationships are difficult
to represent
 We can split a many to
many relationship into two
one to many relationships
 An entity represents the
M:M relationship
Student
Module
Studies Enrolment
Student
Module
In
Has
 To make an E/R model you
need to identify
 Enitities
 Attributes
 Relationships
 Cardinality ratios
 from a description
 General guidelines
 Since entities are things or
objects they are often nouns
in the description
 Attributes are facts or
properties, and so are often
nouns also
 Verbs often describe
relationships between
entities
A university consists of a number of departments. Each department offers several
courses. A number of modules make up each course. Students enrol in a particular
course and take modules towards the completion of that course. Each module is
taught by a lecturer from the appropriate department, and each lecturer tutors a
group of students
A university consists of a number of departments. Each department offers several
courses. A number of modules make up each course. Students enrol in a
particular course and take modules towards the completion of that course. Each
module is taught by a lecturer from the appropriate department, and each lecturer
tutors a group of students
 A university consists of a number of departments. Each department offers
several courses. A number of modules make up each course. Students enrol in a
particular course and take modules towards the completion of that course. Each
module is taught by a lecturer from the appropriate department, and each lecturer
tutors a group of students
ModuleCourse
Department
Student
Lecturer
Entities: Department, Course, Module, Lecturer, Student
ModuleCourse
Department
Student
Lecturer
Offers
Each department offers several courses
ModuleCourse
Department
Student
LecturerIncludes
Offers
A number of modules make up each courses
ModuleCourse
Department
Student
LecturerIncludes
Offers
Enrols In
Students enrol in a particular course
ModuleCourse
Department
Student
LecturerIncludes
Offers
Enrols In
Takes
Students … take modules
ModuleCourse
Department
Student
LecturerIncludes
Offers
Enrols In
Takes
Teaches
Each module is taught by a lecturer
ModuleCourse
Department
Student
LecturerIncludes
Offers
Enrols In
Takes
Employs
Teaches
a lecturer from the appropriate department
ModuleCourse
Department
Student
LecturerIncludes
Offers
TutorsEnrols In
Takes
Employs
Teaches
each lecturer tutors a group of students
ModuleCourse
Department
Student
LecturerIncludes
Offers
TutorsEnrols In
Takes
Employs
Teaches
 Sometimes it is hard to tell
if something should be an
entity or an attribute
 They both represent objects
or facts about the world
 They are both often
represented by nouns in
descriptions
 General guidelines
 Entities can have attributes
but attributes have no
smaller parts
 Entities can have
relationships between them,
but an attribute belongs to a
single entity
We want to represent information about products in a database.
Each product has a description, a price and a supplier. Suppliers
have addresses, phone numbers, and names. Each address is
made up of a street address, a city, and a postcode.
 Entities or attributes:
 product
 description
 price
 supplier
 address
 phone number
 name
 street address
 city
 postcode
 Products, suppliers, and
addresses all have smaller
parts so we can make
them entities
 The others have no smaller
parts and belong to a
single entity
Product
Supplier Address
Street address
City
Postcode
Name
Phone number
Price
Description
 Each product has a
supplier
 Each product has a single
supplier but there is nothing
to stop a supplier supplying
many products
 A many to one relationship
 Each supplier has an
address
 A supplier has a single
address
 It does not seem sensible for
two different suppliers to
have the same address
 A one to one relationship
Product
Supplier Address
Street address
City
Postcode
Name
Phone number
Price
Description
Has A
Has A
 Some relationships
between entities, A and B,
might be redundant if
 It is a 1:1 relationship
between A and B
 Every A is related to a B and
every B is related to an A
 Example - the supplier-
address relationship
 Is one to one
 Every supplier has an
address
 We don’t need addresses
that are not related to a
supplier
 We can merge the two
entities that take part in a
redundant relationship
together
 They become a single entity
 The new entity has all the
attributes of the old one
A B
a
c z
yb
x
AB
z
y
xa
c
b
Product
Supplier
Street address
City
Postcode
Name
Phone number
Price
Description
Has A
 From a description of the
requirements identify the
 Entities
 Attributes
 Relationships
 Cardinality ratios of the
relationships
 Draw the E/R diagram and
then
 Look at one to one
relationships as they might
be redundant
 Look at many to many
relationships as they might
need to be split into two one
to many links
 With a bit of practice E/R
diagrams can be used to
plan queries
 You can look at the diagram
and figure out how to find
useful information
 If you can’t find the
information you need, you
may need to change the
design
Enrolment
Student
Module
In
Has
How can you
find a list of
students who
are enrolled
in Database
systems?
Enrolment
Student
Module
In
Has
(1) Find the instance of the Module
entity with title ‘Database Systems’
(2) Find instances of the Enrolment entity
with the same Code as the result of (1)
(3) For each instance of Enrolment in the
result of (2) find the corresponding Student
ID
Code
Title
Name
ID
Code

More Related Content

What's hot

Database part3-
Database part3-Database part3-
Database part3-
Taymoor Nazmy
 
ER_model
ER_modelER_model
ER_model
Qasim Zahid
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
Bhandari Nawaraj
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
sadeenedian08
 
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
 
Mapping Cardinalities
Mapping CardinalitiesMapping Cardinalities
Mapping Cardinalities
Megha Sharma
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
sadique_ghitm
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in DatabaseFatiha Qureshi
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
Kabindra Koirala
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Shakila Mahjabin
 
ER MODEL
ER MODELER MODEL
ER MODEL
Rupali Rana
 
Er Modeling
Er ModelingEr Modeling
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
Rubal Sagwal
 
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
Arnav Chowdhury
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
yash patel
 
ER Diagram
ER DiagramER Diagram
ER Diagram
Robby Firmansyah
 
D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3askme
 

What's hot (20)

Database part3-
Database part3-Database part3-
Database part3-
 
ER_model
ER_modelER_model
ER_model
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
 
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)
 
Mapping Cardinalities
Mapping CardinalitiesMapping Cardinalities
Mapping Cardinalities
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in Database
 
RDBMS ERD
RDBMS ERDRDBMS ERD
RDBMS ERD
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
Er Modeling
Er ModelingEr Modeling
Er Modeling
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
10287 lecture5(2)
10287 lecture5(2)10287 lecture5(2)
10287 lecture5(2)
 
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
 
Ch 3 E R Model
Ch 3  E R  ModelCh 3  E R  Model
Ch 3 E R Model
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
ER Diagram
ER DiagramER Diagram
ER Diagram
 
D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3
 

Similar to Data base lec3 (erd)

5e7ry754.pptx
5e7ry754.pptx5e7ry754.pptx
5e7ry754.pptx
qwert001
 
ER Diagram- Cardinality.pptx
ER Diagram- Cardinality.pptxER Diagram- Cardinality.pptx
ER Diagram- Cardinality.pptx
SCIENTIFICEARTH
 
Er model
Er modelEr model
Er model
Soumyajit Dutta
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMS
ssuser20b618
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
sandeep54552
 
dbms mannual.pdf
dbms mannual.pdfdbms mannual.pdf
dbms mannual.pdf
DevidasBhere
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er
1ajnabi4u
 
ER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docxER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docx
KameshwariPurusothma
 
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
sukrithlal008
 
Unit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxUnit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptx
nirajsharmapuneiat
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER Model
Ajay Chhimpa
 
ERModel1.pdf
ERModel1.pdfERModel1.pdf
ERModel1.pdf
MirHazarKhan1
 
Database Design and Entity relationship Model.pptx
Database Design and Entity relationship Model.pptxDatabase Design and Entity relationship Model.pptx
Database Design and Entity relationship Model.pptx
yamuna67903
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
MANASINANDKISHORDEOR
 
Data Models
Data ModelsData Models
Data Models
RIAH ENCARNACION
 
Er diagrams
Er diagramsEr diagrams
Er diagrams
VisnuDharsini
 
FIXED INCOMEModule 3 Group Homework1. [6pts] Given a fiv
FIXED INCOMEModule 3 Group Homework1. [6pts] Given a fivFIXED INCOMEModule 3 Group Homework1. [6pts] Given a fiv
FIXED INCOMEModule 3 Group Homework1. [6pts] Given a fiv
ShainaBoling829
 
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
gamuhuto
 
Introduction of Database Design and Development
Introduction of Database Design and DevelopmentIntroduction of Database Design and Development
Introduction of Database Design and Development
Er. Nawaraj Bhandari
 

Similar to Data base lec3 (erd) (20)

5e7ry754.pptx
5e7ry754.pptx5e7ry754.pptx
5e7ry754.pptx
 
ER Diagram- Cardinality.pptx
ER Diagram- Cardinality.pptxER Diagram- Cardinality.pptx
ER Diagram- Cardinality.pptx
 
Er model
Er modelEr model
Er model
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMS
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
dbms mannual.pdf
dbms mannual.pdfdbms mannual.pdf
dbms mannual.pdf
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er
 
ER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docxER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docx
 
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
 
Unit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxUnit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptx
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER Model
 
ERModel1.pdf
ERModel1.pdfERModel1.pdf
ERModel1.pdf
 
Database Design and Entity relationship Model.pptx
Database Design and Entity relationship Model.pptxDatabase Design and Entity relationship Model.pptx
Database Design and Entity relationship Model.pptx
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
Data Models
Data ModelsData Models
Data Models
 
Er diagrams
Er diagramsEr diagrams
Er diagrams
 
FIXED INCOMEModule 3 Group Homework1. [6pts] Given a fiv
FIXED INCOMEModule 3 Group Homework1. [6pts] Given a fivFIXED INCOMEModule 3 Group Homework1. [6pts] Given a fiv
FIXED INCOMEModule 3 Group Homework1. [6pts] Given a fiv
 
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
 
Introduction of Database Design and Development
Introduction of Database Design and DevelopmentIntroduction of Database Design and Development
Introduction of Database Design and Development
 

Recently uploaded

原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
oz8q3jxlp
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
u86oixdj
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
g4dpvqap0
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
javier ramirez
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
eddie19851
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
mzpolocfi
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
dwreak4tg
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
Unleashing the Power of Data_ Choosing a Trusted Analytics Platform.pdf
Unleashing the Power of Data_ Choosing a Trusted Analytics Platform.pdfUnleashing the Power of Data_ Choosing a Trusted Analytics Platform.pdf
Unleashing the Power of Data_ Choosing a Trusted Analytics Platform.pdf
Enterprise Wired
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 

Recently uploaded (20)

原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
一比一原版(Deakin毕业证书)迪肯大学毕业证如何办理
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
Unleashing the Power of Data_ Choosing a Trusted Analytics Platform.pdf
Unleashing the Power of Data_ Choosing a Trusted Analytics Platform.pdfUnleashing the Power of Data_ Choosing a Trusted Analytics Platform.pdf
Unleashing the Power of Data_ Choosing a Trusted Analytics Platform.pdf
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 

Data base lec3 (erd)

  • 1.
  • 2.  Entity/Relationship models  Entities  Relationships  Attributes  E/R Diagrams  For more information  Connolly and Begg chapter no: 11
  • 3.  Before we look at how to create and use a database we’ll look at how to design one  Conceptual design  Build a model independent of the choice of DBMS  Logical design  Create the database in a given DBMS  Physical design  How the database is stored in hardware
  • 4.  E/R Modelling is used for conceptual design Consists of:  Entities - objects or items of interest  Attributes - facts about, or properties of, an entity  Relationships - links between entities  Example  In a University database we might have entities for Students, Subjects and Lecturers. Students might have attributes such as their ID, Name, and Course, and could have relationships with Subjects (enrolment) and Lecturers
  • 5.  E/R Models are often represented as E/R diagrams that  Entity Relationship Model  E-R model is a detailed, logical representation of data for an organization.  It is the graphical representation of data models in the form of entity- relationship diagram
  • 6.  In an E/R Diagram, an entity is usually drawn as a box with rounded corners  The box is labelled with the name of the class of objects represented by that entity Student Lecturer Module Tutors Studies ID CourseName
  • 7.  In an E/R Diagram attributes may be drawn as ovals  Each attribute is linked to its entity by a line  The name of the attribute is written in the oval Student Lecturer Module Tutors Studies ID CourseName
  • 8.  Relationships are an association between two or more entities  Each Student takes several Modules  Each Module is taught by a Lecturer  Each Employee works for a single Department  Relationships have  A name  A set of entities that participate in them  A degree - the number of entities that participate (most have degree 2)
  • 9.  Each entity in a relationship can participate in zero, one, or more than one instances of that relationship  This leads to 3 types of relationship…  One to one (1:1)  Each lecturer has a unique office  One to many (1:M)  A lecturer may tutor many students, but each student has just one tutor  Many to many (M:M)  Each student takes several modules, and each module is taken by several students
  • 10.  Relationships are links between two entities  The name is given in a diamond box  The ends of the link show cardinality Student Lecturer Module Tutors Studies ID CourseName ManyOne
  • 11.  Many to many relationships are difficult to represent  We can split a many to many relationship into two one to many relationships  An entity represents the M:M relationship Student Module Studies Enrolment Student Module In Has
  • 12.  To make an E/R model you need to identify  Enitities  Attributes  Relationships  Cardinality ratios  from a description  General guidelines  Since entities are things or objects they are often nouns in the description  Attributes are facts or properties, and so are often nouns also  Verbs often describe relationships between entities
  • 13. A university consists of a number of departments. Each department offers several courses. A number of modules make up each course. Students enrol in a particular course and take modules towards the completion of that course. Each module is taught by a lecturer from the appropriate department, and each lecturer tutors a group of students
  • 14. A university consists of a number of departments. Each department offers several courses. A number of modules make up each course. Students enrol in a particular course and take modules towards the completion of that course. Each module is taught by a lecturer from the appropriate department, and each lecturer tutors a group of students
  • 15.  A university consists of a number of departments. Each department offers several courses. A number of modules make up each course. Students enrol in a particular course and take modules towards the completion of that course. Each module is taught by a lecturer from the appropriate department, and each lecturer tutors a group of students
  • 25.  Sometimes it is hard to tell if something should be an entity or an attribute  They both represent objects or facts about the world  They are both often represented by nouns in descriptions  General guidelines  Entities can have attributes but attributes have no smaller parts  Entities can have relationships between them, but an attribute belongs to a single entity
  • 26. We want to represent information about products in a database. Each product has a description, a price and a supplier. Suppliers have addresses, phone numbers, and names. Each address is made up of a street address, a city, and a postcode.
  • 27.  Entities or attributes:  product  description  price  supplier  address  phone number  name  street address  city  postcode  Products, suppliers, and addresses all have smaller parts so we can make them entities  The others have no smaller parts and belong to a single entity
  • 29.  Each product has a supplier  Each product has a single supplier but there is nothing to stop a supplier supplying many products  A many to one relationship  Each supplier has an address  A supplier has a single address  It does not seem sensible for two different suppliers to have the same address  A one to one relationship
  • 31.  Some relationships between entities, A and B, might be redundant if  It is a 1:1 relationship between A and B  Every A is related to a B and every B is related to an A  Example - the supplier- address relationship  Is one to one  Every supplier has an address  We don’t need addresses that are not related to a supplier
  • 32.  We can merge the two entities that take part in a redundant relationship together  They become a single entity  The new entity has all the attributes of the old one A B a c z yb x AB z y xa c b
  • 34.  From a description of the requirements identify the  Entities  Attributes  Relationships  Cardinality ratios of the relationships  Draw the E/R diagram and then  Look at one to one relationships as they might be redundant  Look at many to many relationships as they might need to be split into two one to many links
  • 35.  With a bit of practice E/R diagrams can be used to plan queries  You can look at the diagram and figure out how to find useful information  If you can’t find the information you need, you may need to change the design Enrolment Student Module In Has How can you find a list of students who are enrolled in Database systems?
  • 36. Enrolment Student Module In Has (1) Find the instance of the Module entity with title ‘Database Systems’ (2) Find instances of the Enrolment entity with the same Code as the result of (1) (3) For each instance of Enrolment in the result of (2) find the corresponding Student ID Code Title Name ID Code