Business Analysis Entity Modelling Chris Russell O2.41

Slides:



Advertisements
Similar presentations
Database Design Lessons 2 & 3 Database Models, Entities, Relationships.
Advertisements

Entity-Relationship Modeling (ER-M)
ENTITY RELATIONSHIP MODELLING
Databases Revision.
Logical Data Modelling
Entity-Relationship Model and Diagrams (continued)
Entity/Relationship Modelling
Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
Conceptual Design Lecture - 2 Database Development.
BIS 360 – Lecture Six (Part 2) Conceptual Data Modeling (Chapter 10 and partial Chapter 12)
Concepts and Terminology Introduction to Database.
Database Systems Lecture # 7 8 th Feb, Conceptual and Logical Design Person buys Product name pricenamessn Conceptual Model: Relational Model: (plus.
Copyright Ó Oracle Corporation, All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
1 IRU – database design part one Geoff Leese September 2009.
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
IT 21103/41103 System Analysis & Design. Chapter 04 Data Modeling.
Dr Gordon Russell, Napier University Data Analysis 3 - V2.0 1 Data Analysis 3 Unit 2.3.
Data Analysis 3 Chapter 2.3 V3.0 Napier University Dr Gordon Russell.
INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.
advanced data modeling
Copyright Ó Oracle Corporation, All rights reserved. Assign Unique Identifiers A Unique Identifier (UID) is any combination of attributes and/or.
Agenda  TMA01  M876 Block 2 Relational Theory. Data Modeling.
Entity/Relationship Modelling. Entity Relationship Modelling In This Lecture Entity/Relationship models Entities and Attributes Relationships Attributes.
Tutorial 2 Data Modelling. 3 Terminology & Notation(1) An entity is an object about which the system needs to hold information –Customer, Student, Course.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
ENTITY RELATIONSHIP DIAGRAM. Objectives Define terms related to entity relationship modeling, including entity, entity instances, attribute, relationship.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Entity Relationship Modeling
Entity/Relationship Modelling
Entity-Relationship Model
Chapter 5 UNDERSTANDING AND DESIGNING ACCOUNTING DATA
Tables and Their Characteristics
Database Design – Lecture 4
Entity-Relationship Modelling
Chapter 7 Entity-Relationship Model
Entity-Relationship Modeling
CIS 207 The Relational Database Model
Mr C Johnston ICT Teacher
Lecture 2 The Relational Model
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
Translation of ER-diagram into Relational Schema
Entity-Relationship Model and Diagrams (continued)
Entity Relationships and Normalization
Accounting System Design
Database Systems: Design, Implementation, and Management Tenth Edition
Business Analysis DFD Levelling Chris Russell O2.41
Session 2 Welcome: The seventh learning sequence
Entity-Relationship Modelling
Data Modeling for Database Design 2
Accounting System Design
Business Analysis Introduction to Classes Chris Russell O2.41
Chapter 2 Modeling Data in the Organization
Database Systems Instructor Name: Lecture-9.
Database Modeling using Entity Relationship Model (E-R Model)
Database Systems Instructor Name: Lecture-10.
Business Analysis Entity Life History Chris Russell O2.41d
Business Analysis More on Classes Chris Russell O2.41
Business Analysis Sequence Diagrams Chris Russell O2.41
Relationships—Topics
Business Analysis Good Enough Software Chris Russell O2.41
Workshop Exercise (Week 6)
Entity Relationship Model
Relational Database Model
Data Analysis 3 Unit 2.3 Dr Gordon Russell, Napier University
Workshop Exercise (Week 6)
Presentation transcript:

Chris Russell O2.41 02920 41 6431 crussell@cardiffmet.ac.uk Business Analysis Entity Modelling Chris Russell O2.41 02920 41 6431 crussell@cardiffmet.ac.uk Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Session schedule Business Analysis Schedule Academic Year 2014-5 Semester 2 Week Topic 1 Introduction 2 Investigate situation: rich picture, context diagrams 3 Consider perspectives: types of participation, CATWOE, Power-Interest, Thomas-Kilmann 4 Analyse needs 1: Use Cases 5 Analyse needs 2: structured techniques 6 Define requirements 1a: SSADM 7 Define requirements 1b: SSADM EASTER 8 Define requirements 2: UML 9 Generic assignment feed-forward and task review 10 Balance good enough software against quality costs; Prioritise requirements 11 Assignment submisison Lecture BA13 Entity Modelling

Activities and Paradigms Investigate Situation Consider Perspectives Analyse Needs Define Requirements Socio-technical Rich picture CATWOE Types of participation Thomas-Kilmann Power-Interest X Functional Level 0 diagram Structured techniques DFD, ERM and ELH Object-Oriented Context diagram Use Cases Class and Sequence diagrams Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Contents Logical Data Modelling Revision Key concepts Examples Lecture BA13 Entity Modelling

Logical Data Modelling The DFD tells us how: data is processed by a system data is stored within a system But not the meaning or structure of such data - this is the concern of Logical Data Modelling Lecture BA13 Entity Modelling

Logical Data Modelling Consists of: the Logical Data Structure (LDS) diagram a set of associated textual descriptions LDM is similar to Entity Relationship Modelling; LDS is similar to the Entity Relationship Diagram Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Revision: relation Attributes Keyfield Personnel 18/2/71 2 Hardy Rd Brown, G 7138 Accounts 12/8/60 92 Coleridge St Smith, R 3812 Purchasing 10/5/50 10 Milton St Bloggs, F 1234 Dept DOB Address Name Emp# Tuples Lecture BA13 Entity Modelling Employee Number 7138

Lecture BA13 Entity Modelling Revision: degree The “degree” of a relation is the number of attributes 4 3 1 2 5 Personnel 18/2/71 2 Hardy Rd Brown, G 7138 Accounts 12/8/60 92 Coleridge St Smith, R 3812 Purchasing 10/5/50 10 Milton St Bloggs, F 1234 Dept DOB Address Name Emp# Lecture BA13 Entity Modelling

Revision: cardinality The “cardinality” of a relation is the total number of tuples existing at some time instant 3 2 1 Personnel 18/2/71 2 Hardy Rd Brown, G 7138 Accounts 12/8/60 92 Coleridge St Smith, R 3812 Purchasing 10/5/50 10 Milton St Bloggs, F 1234 Dept DOB Address Name Emp# Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Revision: domain The domain of an attribute is the set of values from which it is taken The domain of Emp# could be the set of all 4 digit integers between 1000 and 9999 The domain of DOB could be all valid dates so, for example, 32/6/71 is invalid The domain of the department could be (Purchasing : Accounts : Personnel ) Lecture BA13 Entity Modelling

Revision: referential Integrity Foreign Key Employee Table Accounts NULL 5823 Purchasing 8146 Personnel 18/2/71 2 Hardy St Brown, G 7138 12/8/60 92 Coleridge Cr Smith, R 3812 20/5/50 10 Milton St Bloggs, F 1234 Dept DOB Address Name Emp# Department Table Annexe 1921 Administration Main 5823 Accounts 8146 Purchasing Building Manager# Dept Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Key concepts Entities Relationships Degree Optionality Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Entities A thing - object, concept, group of people etc - about which the system needs to store information Not the same as an External Entity in a DFD Notation: a round cornered rectangle containing the entity’s - unique - name Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Entities “Qualifications” required for an entity: There must be more than one occurrence Each occurrence should be uniquely identifiable There must be data that we want to hold about the entity It should be of direct interest to the system Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Relationships Each entity is related to at least one other entity Notation: related entities are linked by a line, labelled in both directions The line is annotated with the relationship’s degree and optionality Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Degree The degree to which any two entities are related must be indicated: Many to Many (m:n) - each occurrence of A is related to one or more occurrences of B, and vice-versa. One to Many (1:m) - each occurrence of A is related to one or more occurrences of B, but each occurrence of B is related to only one occurrence of A. Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Degree Degrees (cont.)… One to One (1:1) - each occurrence of A is related to only one occurrence of B, and vice-versa. Notation: “crow’s feet” are added to the line at the “many” end In a 1:m relationship “m” should be at the bottom Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Optionality If an occurrence of one entity is not related to at least one occurrence of the other, then the relationship is optional rather than mandatory. Notation: dashed line at the optional end(s) Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling An example A university At a university, students are tutored by Lecturers. A student registers for a course at enrolment. The course consists of modules, which the student is required to attend. These modules are taught by Lecturers. Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Course Module Student Making up Consists of Registers Is registering Is tutored Lecturer Tutors Is taught by Teaches Attends Is Attended by Student RegNo, Name, Address, DateJoined Lecturer StaffNo, Name, extension Course CNo, Title, Duration Module ModNo, Module, Semester ,staffno 1:M Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Course Module Student Making up Consists of Registers Is registering Is tutored Lecturer Tutors Is taught by Teaches Attends Is Attended by Student RegNo, Name, Address, DateJoined Lecturer StaffNo, Name, extension Course CNo, Title, Duration Module ModNo, Module, Semester ,staffno ,Cno 1:m Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling 1:m Relationships Course(cno, name, duration) Student(sno, name, address) Course Student Enrols Consists of The primary key of table course (cno) can be placed in table student as an additional (foreign key) attribute. Thus student becomes: Student(sno, name, address,cno) Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling ,Cno Course Module Student Making up Consists of Registers Is registering Is tutored Lecturer Tutors Is taught by Teaches Attends Is Attended by Student RegNo, Name, Address, DateJoined Lecturer StaffNo, Name, extension Course CNo, Title, Duration Module ModNo, Module, Semester ,staffno ,Cno 1:m Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Student RegNo, Name, Address, DateJoined ,staffno ,Cno Lecturer StaffNo, Name, extension Module ModNo, Module, Semester ,Cno Course CNo, Title, Duration Is tutored Student Attends Registers Is registering M:N Course Consists of Making up Tutors Is Attended by Teaches Module Lecturer Is taught by Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling M:N Relationships Student Module Grade achieves Is achieved by awards Is awarded for Student Module attends Is attended by 1:M {New Entity} 1:M Lecture BA13 Entity Modelling

M:N Relationships(Cont.) The primary key of Student (sno) can be placed in Grade as an additional (foreign key) attribute. Thus Grade becomes: Grade sno Student Module Grade achieves Is achieved by awards Is awarded for The primary key of Module (mno) can be placed in Grade as an additional (foreign key) attribute. Thus Grade becomes: Grade sno, mno Lecture BA13 Entity Modelling

M:N Relationships(Cont.) Both attributes now become keys. Therefore: Grade (sno, mno) Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Student RegNo, Name, Address, DateJoined ,staffno ,Cno Lecturer StaffNo, Name, extension Module ModNo, Module, Semester ,Cno Course CNo, Title, Duration Grade RegNo, ModNo, Ass1, Ass2, Exam,…) Student Is tutored achieves Registers Is achieved by Is registering Course Grade Consists of Is awarded Making up Tutors Teaches Module Lecturer Is taught by awards Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Student (RegNo, Name, Address, DateJoined ,staffno ,Cno Lecturer (StaffNo, Name, extension Module (ModNo, Module, Semester ,Cno Course (CNo, Title, Duration Grade (RegNo, ModNo, Ass1, Ass2, Exam,…) Student Is tutored achieves Registers Is achieved by Is registering Course M:N Grade Consists of Is awarded Making up Tutors Teaches Module Lecturer Is taught by awards Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Student (RegNo, Name, Address, DateJoined ,staffno ,Cno Lecturer (StaffNo, Name, extension Module (ModNo, Module, Semester ,Cno Course (CNo, Title, Duration Grade (RegNo, ModNo, Ass1, Ass2, Exam,…) Delivery (Staffno, ModNo) Student Is tutored achieves Registers Is achieved by Is registering Course Grade Consists of Is awarded Making up Tutors Teaches Module Lecturer awards Lecture BA13 Entity Modelling Delivery

Lecture BA13 Entity Modelling 1:1 Relationship Three Options: Can I join the two entities? Can I use the same key? Either the primary key of the entity Country may be a foreign key in for the entity City or vice-versa (but not both). Country City Has a capital Is the capital of Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Another example The Count Moneybags General Hospital The Count Moneybags General Hospital deals with patients using an appointments system. Patients must make an appointment for a clinic session held at one of the hospital's clinics. Doctors are allocated one or more appointments within a clinic session, but only one doctor will be present at each appointment. Operations are scheduled and allocated to one of a number of theatre sessions held in the hospital's operating theatres. Each doctor may perform a number of given operations on patients. Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Entity Matrix Hospital x Clinic x Clinic Session x Appointment x x Doctor x x Patient Hospital x Operating Theatre x Theatre Sessions x Operation x Doctor x x Patient Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling This week, Next week Task 10 in Seminar ELH in Lecture Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Relationships Hospital Operating Theatre Clinic Theatre Sessions Clinic Session Doctor Operation Appointment Patient Lecture BA13 Entity Modelling Add the Cardinality

Lecture BA13 Entity Modelling Remove the Many to many relationships. Relationships and cardinality Hospital Operating Theatre Clinic Theatre Sessions Clinic Session Doctor Operation Appointment Patient Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling Relationships and cardinality Hospital Operating Theatre Clinic Theatre Sessions Clinic Session Doctor Operation Appointment Patient Patient- Operation Link Patient- Appointment Link Lecture BA13 Entity Modelling

Lecture BA13 Entity Modelling x Entity 2 x Entity 3 x Entity 4 x Entity 5 Entity 6 x x Lecture BA13 Entity Modelling