Entity-Relationship Modelling

Slides:



Advertisements
Similar presentations
1 SA0951a Entity-Relationship Modelling. 2 What is it about? ER model is used to show the Conceptual schema of an organisation. Independent of specific.
Advertisements

Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
CSC271 Database Systems Lecture # 22. Summary: Previous Lecture  Applying Database SDLC on DreamHome  Database planning  System definition  Requirements.
Entity-Relation Modeling Hun Myoung Park, Ph.D., Public Management and Policy Analysis Program Graduate School of International Relations International.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Lecture Eleven Entity-Relationship Modelling
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Data Modeling Using the Entity-Relationship Model
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Entity-Relationship Modeling Based on Chapter 12.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts UML UML: Unified Modeling Language UML has many components to graphically model different.
1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
advanced data modeling
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Module 8: Entity-Relationship.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
ENTITY- RELATIONSHIP MODELLING 1 All rights reserved by
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Data Modeling Using the Entity- Relationship (ER) Model
COP Introduction to Database Structures
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Data Modeling Using the ERD
Data Modeling Using the Entity- Relationship (ER) Model
Entity- Relationship (ER) Model
Conceptual Design & ERD Modelling
Entity-Relationship Model
TMC2034 Database Concept and Design
Entity Relationship Model
Entity Relationship (E-R) Modeling
Entity-Relationship Model
Tables and Their Characteristics
Chapter -3- Data Modeling Using the Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Entity-Relationship Modelling
Chapter 7 Entity-Relationship Model
Outline of the ER Model By S.Saha
Entity-Relationship Modeling
Lecture3: Data Modeling Using the Entity-Relationship Model.
بسم الله الرحمن الرحيم.
Conceptual data modeling
Module 8 – Database Design Using the E-R Model
Entity-Relationship Modeling
Chapter 4 Entity Relationship (ER) Modeling
Entity-Relation Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Database Modeling using Entity Relationship Model (E-R Model)
Review of Week 1 Database DBMS File systems vs. database systems
Conceptual Data Modeling Using Entities & Relationships
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.
Chapter 4 Entity Relationship (ER) Modeling
Chapter 7: Entity-Relationship Model
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Entity Relation Model Tingting Zhang.
ER MODELING Instructor: SAMIA ARSHAD
Chapter # 4 Entity Relationship (ER) Modeling.
Chapter 6b: Database Design Using the E-R Model
Presentation transcript:

Entity-Relationship Modelling

What is it about? ER model is used to show the Conceptual schema of an organisation. Independent of specific data model or DBMS The model is later transformed into a Logical model (e.g. relational) on which the physical database is built The most widely used form of Semantic modelling: attempt to capitalise on knowledge of meaning of data to inform the model So we need a vocabulary

The Entity Relationship Model Perspective This was lecture 1! Organisation Information System ERM Relational Model Physical data storage Conceptual Model Logical Model Physical Model

Entities Relationships Attributes Skills and concepts So the concepts we want you to learn today are: The basics of Entity-Relationship modelling Entities Relationships Attributes

Entities Entity - distinguishable “thing” in the real world Strong (or regular) entity - entities have an independent existence (e.g. staff) Weak entity - existence dependent on some other entity (e.g. next of kin) Entity type name (singular, no spaces, capital letter at start of each word) space for attributes

Attributes Entity types have Attributes (or properties) which associate each entity with a value from a domain of values for that attribute Attributes can be simple (atomic) e.g. Surname; date of birth composite e.g. address (street, town, postcode) multi-valued e.g. phone number complex nested multi-valued and composite base or derived e.g. D.O.B. ; age key Relationship types can also have attributes! (see later)

Notation for attributes Primary Key marked {PK} Composite attribute Derived Attribute {PPK} Multi-Valued Attribute (number of values in [ ] brackets) Partial Key - part of composite PK - or of a weak entity

Relationships A relationship is “.. An association among entities (the participants)..” Relationships link entities with each other Name: verb, capital start letter, arrow indicates direction in which verb makes sense

Relationships: constraints The degree of a relationship type binary (connects 2 entity types) unary/ recursive (connects 1 entity type with itself) complex (connects 3 or more entity types) Ternary (connects 3) Relationship constraints - cardinality one to one (1:1) one to many (1:m) many to many (m:n) Relationship constraints – participation full/mandatory or partial/optional Degree Multiplicity

Relationships: Degree Binary relationship Recursive (Unary) relationship - example Complex relationship – here ternary

Relationships: Multiplicity label lines to show cardinality and participation 0..1 “zero or one” 0..* “zero or more” 1..1 “one” 1..4 “between 1 and 4” 1..* “one or more” optional mandatory 1..1 0..* Entity1 has a 1:m relationship with Entity2; participation for Entity2 is mandatory, for Entity1 optional.

Total and Partial Participation Total participation (indicated by double line): every entity in the entity set participates in at least one relationship in the relationship set participation of student in advisor relation is total every student must have an associated instructor Partial participation: some entities may not participate in any relationship in the relationship set Example: participation of instructor in advisor is partial

Relationships example Manages Manager Department 1..1 0..3 responsibility [1..*] dateAllocated Each department is managed by ONE manager Each manager manages UP TO 3 departments (but need not manage any department) Relationship attributes

Over to You now! See if you can draw an E-R diagram for this scenario – you are already familiar with this! “A student registers for up to 8 modules and each module has many students on it. Record the student ID, their full name and address and also each module ID and title. We also want to hold the grade attained by each student for each module” Remember to show in your model: All primary keys, Entities Relationships Attributes

Unary Example with Data A member of staff may supervise another staff member, but a staff member may be supervised by one or more staff members  supervises 0..* Staff 0..1 STAFF Member Age Supervisor Grey 43 Black Black 27 Brown 35 Black White 33 Brown

Ternary Diagrams are Tricky! “a client at a branch will be registered by one member of staff” “a member of staff will register a client at one branch” registers 1..1 1..1 Staff Branch 0..* “a member of staff at a branch may register many clients” Client Try to determine participation/cardinality by operating in pairs Scenario modified from Connolly & Begg page 350

Key Points ERM Entities (strong, weak) Attributes (simple, composite, etc) Relationships Degree Cardinality participation Model with the UML notation at conceptual level

Summary of Symbols Used in E-R Notation

Symbols Used in E-R Notation (Cont.)

Alternative ER Notations Chen, IDE1FX, …

Alternative ER Notations Chen IDE1FX (Crows feet notation)

UML UML: Unified Modeling Language UML has many components to graphically model different aspects of an entire software system UML Class Diagrams correspond to E-R Diagram, but several differences.

ER vs. UML Class Diagrams *Note reversal of position in cardinality constraint depiction

ER vs. UML Class Diagrams ER Diagram Notation Equivalent in UML *Generalization can use merged or separate arrows independent of disjoint/overlapping

UML Class Diagrams (Cont.) Binary relationship sets are represented in UML by just drawing a line connecting the entity sets. The relationship set name is written adjacent to the line. The role played by an entity set in a relationship set may also be specified by writing the role name on the line, adjacent to the entity set. The relationship set name may alternatively be written in a box, along with attributes of the relationship set, and the box is connected, using a dotted line, to the line depicting the relationship set.