Database Systems ER Diagramming Tutor:Ian Perry Tel:01723 35 7287 Web:http://itsy.co.uk/units/dbs0204/http://itsy.co.uk/units/dbs0204/

Slides:



Advertisements
Similar presentations
44220: Database Design & Implementation ER Diagramming
Advertisements

ENTITY RELATIONSHIP MODELLING
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
IT420: Database Management and Organization
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Modeling the Data: Conceptual and Logical Data Modeling
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Lecture Eleven Entity-Relationship Modelling
Methodology Logical Database Design for the Relational Model
Chapter Five Data Modeling with the Entity-Relationship Model.
Lecture 10 Conversion to tables Database Design Concepts INFO1408.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Enhanced ER modeling techniques Transparencies
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
BTM 382 Database Management Chapter 4: Entity Relationship (ER) Modeling Chitu Okoli Associate Professor in Business Technology Management John Molson.
Entity Relationship Model Chapter 6. Basic Elements of E-R Model Entity Object of the real world that stores data. Eg. Customer, State, Project, Supplier,
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
Entity-Relationship modeling Transparencies
Entity-Relationship Modeling I The cautious seldom err. Confucius.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Data Modeling and Relational Database Design. Analyze and model the relationships between entities Draw an initial entity relationship diagram Read the.
44220: Database Design & Implementation Review & Assignment 1
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
44220: Database Design & Implementation Logical Data Modelling Ian Perry Room: C48 Tel Ext.: 7287
Chapter 5 Entity–Relationship Modeling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Copyright (c) 2014 Pearson Education, Inc. Introduction to Databases.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
44220: Database Design & Implementation Review & Assignment 2 Ian Perry Room: C49 Tel Ext.: 7287
44220: Database Design & Implementation Implementing Physical Domains Ian Perry Room: C49 Tel Ext.: 7287
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
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.
4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Relationship Degree Indicates number of entities or participants.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Database Systems Module Review
ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.
Hazırlayan MODELLING THE DATA STRUCTURE Entity Modelling & Entity Relationship Diagrams Yard.Doç.Dr. Zehra KAMIŞLI ÖZTÜRK.
Jozef Kuper.  Describe a Database  Entities  Atributes  Relationships.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
In this session, you will learn to: Map an ER diagram to a table Objectives.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Entity Relationship Modeling
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
44220: Database Design & Implementation Review & Assignment 2 Ian Perry Room: C41C Tel Ext.: 7287
44220: Database Design & Implementation Implementing Physical Domains Ian Perry Room: C41C Tel Ext.: 7287
Database Design – Lecture 4 Conceptual Data Modeling.
44220: Database Design & Implementation Conceptual Data Modelling Ian Perry Room: C49 Tel Ext.: 7287
Link tables and keys Access/IPS Walsall College of Arts & Technology.
Database Systems Avoiding Database Anomalies Tutor:Ian Perry Tel: Web:
Tutorial 2 Data Modelling. 3 Terminology & Notation(1) An entity is an object about which the system needs to hold information –Customer, Student, Course.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
DBMS ER model-2 Week 6-7.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
44271: Database Design & Implementation Physical Data Modelling Ian Perry Room: C49 Tel Ext.: 7287
Database Systems Logical Data Modelling Tutor:Ian Perry Tel: Web:
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
Chapter Two Database Design (ER Model) Objectives: ER model Type of relationships Role in a relation Concept of Weak entities.
Tables and Their Characteristics
Presentation transcript:

Database Systems ER Diagramming Tutor:Ian Perry Tel: Web:

Ian PerrySlide 2 Conceptual Data Modelling 1. Identify ALL of the relevant Entities. must play a necessary role in the business system. 2. Identify those Attributes that adequately describe each Entity. remember to choose ‘key’ attribute(s). 3. Identify the Relationships between Entities. determine the Degree of each Relationship: determine the Type of each Relationship. attempt to decompose any many-to-many Relationships that you have identified.

Ian PerrySlide 3 Hospital Example Let us suppose that you have been asked to build a Conceptual Data Model for a Hospital. The questions you must ask (and answer?) are as follows: –What are the major objects of interest? Entities –What details adequately describe each of these objects? Attributes –What associations are valid between these objects? Relationships

Ian PerrySlide 4 What are the Entities? i.e. the major objects of interest. –Doctor –Nurse –Ward –Patient –Medication –Operating Theatre –Outpatients Clinic –etc.

Ian PerrySlide 5 What are the Attributes? i.e. the details that adequately describe each of the Entities. –Doctor Name, Room, Extension, Speciality, … –Nurse Name, Room, Extension, Speciality, … –Ward Name, Location, Number of Beds, … –Patient Name, Address, Date-of-Birth, Gender, …

Ian PerrySlide 6 Entity Definition Syntax: EntityName (identifier, attribute1, attribute2,...) For Example: Staff (FirstName, FamilyName, Role, Room, Extension, Speciality, …) Ward (WardName, Location, Number-of-Beds, …) Medication (DrugCode, Type, Dosage, …) Patient (FirstName, FamilyName, DOB, Address, Gender, …) Always Remember: –to indicate the ‘key’ Attribute(s).

Ian PerrySlide 7 ‘Type’ of Relationships? i.e. associations that are valid between Entities. –Staff work in Ward. –Patient allocated to Ward. –Patient receive Medication. –Patient is booked for Operation. –Staff perform Operation. –Patient has undergone Operation. –Patient attends Clinic. –Etc.

Ian PerrySlide 8 ‘Degree’ of Relationships? One_to_One (1:1) –very rare! One_to_Many (1:M or M:1) –most often used relationship, good for both Logical and Physical Modelling. Many_to_Many (M:N) –quite common, but are impossible to implement either Logically or Physically. –must be decomposed into two One-to-Many relationships linked by a ‘new’ Entity.

Ian PerrySlide 9 Occurrence Diagrams? Use these to get straight how many occurrences of each Entity are on either side of a Relationship. Staff Fred Smith Jane Bloggs Arthur Jones Angela Oust Ward Ward 1 Ward 2 Ward 3

Ian PerrySlide 10 Participation in a Relationship? Mandatory: –compulsory attachment. Contingent: –compulsion on one side only. Optional: –no compulsory attachment for either. Inclusive: –attachment only occurs when another relationship exists. Exclusive: –only one attachment from a set of possible relationships is permitted.

Ian PerrySlide 11 Degree, Type & Participation - 1 One-to-Many, Mandatory (compulsory) Hospital Ward has => 1M <= are in One-to-Many, Contingent (compulsion one side) PatientOperation is booked for => 1M <= performed on StaffWard work in => M N <= have Many-to-Many, Optional (no compulsion)

Ian PerrySlide 12 Degree, Type & Participation - 2 One-to-Many, Contingent (compulsion one side) Ward Patient has beds for => 1M <= stay in Clinic Patient caters for => 1M <= attend One-to-Many, Contingent (compulsion one side)

Ian PerrySlide 13 Decompose Complex Relationships WardKeyStaffKey WardKey Which MUST be decomposed into 2 x one-to-many Relationships - like this: Staff Ward Ward Team M 1 M 1 <= has work in => StaffWard work in => M N <= have Can’t have any many-to-many Relationships - for example this one:

Ian PerrySlide 14 Rules for Drawing ER Diagrams Need to look good, so: –don’t draw them by hand! Need to be well laid out, so that: –Entities with several Relationships are in the centre of the diagram. –Related Entities are adjacent to each other. –Relationship lines do not cross.

Ian PerrySlide 15 The final Degree, Type & Participation Diags. Hospital Ward has => 1M <= are in PatientOperation is booked for => 1M <= performed on Ward Patient has beds for => 1M <= stay in Clinic Patient caters for => 1M <= attend Staff Ward Ward Team M 1 M 1 <= has work in =>

Ian PerrySlide 16 Plan BEFORE you begin! Both ‘Patient’ and ‘Ward’ have Relationships with three other Entities: –so place these in the centre of the Diagram. ‘Ward Team’ has Relationships with two Entities: –so, place this a little further out. The other four Entities only have one Relationship each: –so, they should be placed close to the Entity that they have a Relationship with. Join all of the Entities: –indicating the Degree, Type and Participation of each Relationship.

Ian PerrySlide 17 Hospital Example ER Diagram has => 1 M Hospital Ward <= are in Staff Ward Team M 1 M 1 work in => has => Patient <= has beds for 1 M stay in => Clinic caters for => 1 M <= attend Operation booked for => 1 M performed on =>