Fichas
ER DIAGRAM

Fichas del conjunto (23)
- 1ER DIAGRAMENTITY RELATIONSHIP MODELS
• Entities and Attributes
• Relationships
• Attributes
• E/R Diagrams - 2DATABASE DESIGN

- 3ENTITY / RELATIONSHIP MODELLING- E/R Modelling is used for conceptual design.
• Entities - objects or
items of interest.
• Attributes - facts
about, or properties
of, an entity.
• Relationships - links
between entities. - 4ENTITY / RELATIONSHIP DIAGRAMS• E/R Models are often as E/R diagrams that:
•*Give a conceptual view of the database
•*Are independent of the choice of DBMS
*Can identify some problems in a design - 5ENTITIES• Entities represent objects or things of interest.
• Physical things like students, lecturers, employees, products.
• More abstract things like modules, orders,
courses, projects. - 6DIAGRAMMING ENTITIES* 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. - 7ATTRIBUTESAttributes are facts, aspects, properties, or details about an entity.
• Students have IDs, names, courses, addresses, …
• Modules have codes, titles, credit weights,
levels, … - 8DIAGRAMMING ATTRIBUTES-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. - 9RELATIONSHIPSRelationships 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 - 10CARDINALITY RATIOSEach entity in a relationship can participate in zero, one, or more than
one instances of that relationship
This leads to 3 typesof 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. - 11DIAGRAMMING RELATIONSHIPS* Relationships are links between two
entities.
* The name is given in a diamond box
* The ends of the link show cardinality - 12Removing M:M Relationships* 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. - 13MAKING ER MODELS-To make an E/R model you need to identify
• Enitities
• Attributes
• Relationships
• Cardinality ratios
- 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. - 14EXAMPLEA 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. - 15EXAMPLE - ENTITIES
- 16EXAMPLE - RELATIONSHIPS
- 17EXAMPLE : ER DIAGRAM
- 18EXAMPLE : ER DIAGRAMNOTES : PLEASE CHANGE THE CONNECTIVITY INTO " CHEN NOTATION".
One-to-One
One-to-Many
Many-to-Many - 19ENTITIES AND ATTRIBUTES* 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. - 20EXAMPLE : ENTITIES AND ATTRIBUTES
- 21EXAMPLE : ER DIAGRAM ENTITIES AND ATTRIBUTES
- 22EXAMPLES : RELATIONSHIPSome 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. - 23EXAMPLE : ER DIAGRAM
Información
- Descripción
- Focus on Chen Notation
- Creado por
- nurhidayah.mazni
- Visitas
- 140
- Etiquetas
- Valoración