Tutorial 1 Entity Relationship Modelling. Entities and what they mean One-to-many Header-Items Invoice/ Invoice Items Customer/ Customer- Branch Bidirectional.

Slides:



Advertisements
Similar presentations
Copyright Irwin/McGraw-Hill Data Modeling Prepared by Kevin C. Dittman for Systems Analysis & Design Methods 4ed by J. L. Whitten & L. D. Bentley.
Advertisements

Accounting System Design
Normalisation Ensuring data integrity in database design 1.
Logical Data Modeling Review Lecture for University of Agder, Grimstad DAT202 Databaser (5.5.11) Judith Molka-Danielsen
Data Modelling II. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis Feasibility Maintenance.
Agenda for Week 1/31 & 2/2 Learn about database design
Entity-Relationship Model and Diagrams (continued)
Normalisation up to 1NF Bottom-up Approach to Data Modelling.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Further Data Modelling …and the effect of time. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis –Further.
Topic Database Modelling S McKeever Advanced Databases 1.
WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code.
Entity-Relationship Modelling Introduced by Chen in 1976 The ER Model is used to construct the conceptual data model – independent of DBMS Most widely.
Lesson-19 Data Modeling and Analysis
Chapter 3: Data Modeling
Week 2 Lecture 2 Structure of a database. External Schema Conceptual Schema Internal Schema Physical Schema.
BIS310: Week 7 BIS310: Structured Analysis and Design Data Modeling and Database Design.
 An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships between entities in a database.  An Entity Relationship.
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,
Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Data Modeling ERM ERD.
Module Title? DBMS E-R Model to Relational Model.
DATA MODELLING TOOLS FOR ORGANISING DATABASES. For a database to be organised and logical, it must be well-designed and set out. In such cases, the databases.
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
Business Process Modeling
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
DATA MODELING AND DATABASE DESIGN
The Structured Specification. Why a Structured Specification? System analyst communicates the user requirements to the designer with a document called.
Driving School Database
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Entity Relationship Diagram (ERD) 22 February 2011.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Concepts and Terminology Introduction to Database.
G057 - Lecture 02 Introduction To Database System Concepts Mr C Johnston ICT Teacher
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 2 This material was developed by Oregon Health & Science.
Richard Merritt1 Data Modelling Entities, Attributes and Relationships.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
1 Information Retrieval and Use Data Analysis & Data Modeling, Relational Data Analysis and Logical Data Modeling Geoff Leese September 2009.
Information Systems & Databases 2.2) Organisation methods.
1 A Guide to MySQL 2 Database Design Fundamentals.
What we’ve learnt Doc 5.69 Doc 5.70 Section 1-3. A simple database Related objects Tables hold the data Forms, reports, queries to access the data.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
1. Objectives At the end of this chapter you should be able to:  Discuss the use and features of a data model  Define the terms entity and attribute.
Carmen David, Senior BA Business Analysis Carmen David, Senior BA Business Analysis Foundation in Business Analysis Session 7 MODELLING REQUIREMENTS.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
IFS310: Module 6 3/1/2007 Data Modeling and Entity-Relationship Diagrams.
ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.
In this session, you will learn to: Map an ER diagram to a table Objectives.
+ Information Systems and Databases 2.2 Organisation.
Relational Database. I. Relational Database 1. Introduction 2. Database Models 3. Relational Database 4. Entity-Relationship Models 5. RDB Design Principles.
Chapter Two ( Database Design) Objectives Learn how to design a DBMS Introduction to Data Models Entity-Relationship Data Models.
Database Basics BCIS 3680 Enterprise Programming.
Chapter 56 Relational Database Design Compiled by Eddie Moorcroft.
INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.
Description and exemplification of entity/event modelling. Index and Key – –The Index/Key column of the data dictionary is used to indicate whether or.
Mr C Johnston ICT Teacher
Link tables and keys Access/IPS Walsall College of Arts & Technology.
Topic 3 – Data Modeling Techniques Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
Tutorial 2 Data Modelling. 3 Terminology & Notation(1) An entity is an object about which the system needs to hold information –Customer, Student, Course.
Sample Table Standard Notation Entity name in uppercase
Description and exemplification use of a Data Dictionary. A data dictionary is a catalogue of all data items in a system. The data dictionary stores details.
Information Systems Database Systems (H).
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
COP Introduction to Database Structures
Entity Relationship Modeling
Entity-Relationship Model and Diagrams (continued)
Presentation transcript:

Tutorial 1 Entity Relationship Modelling

Entities and what they mean One-to-many Header-Items Invoice/ Invoice Items Customer/ Customer- Branch Bidirectional view Supplier/ Parts Books/ Characters

So what does that mean ? (1) CUSTOMER(CustID, CustName, CustAddress, Credit_Limit, Curr_Bal) CUSTBR(CustID, BranID, BranName, BranAddress, Credit_Limit, Curr_Bal) On INSERTing CUSTBR record check that CUSTBR.CUSTID is in some CUSTOMER.CUSTID

So what does that mean ? (2) CustIDCustNameCustAddrCredit_LimCurr_Bal Dunn0001Dunnes Stores Main Street, Dublin £1000£15.45 CustIDBranIDBranNameBranAddrCredit_LimCurr_Bal Dunn0001RATH0001RathminesDublin 6£200£0.40 Dunn0001JERV0001Jervis St.Dublin 2£300£6.05 Dunn0001DAWS0001Dawson St. Dublin 2£300£6.00 Dunn0001WICK0001Wicklow £200£3.00

Developing a Data Model Entity-Relationship modelling How to get an ERD

8 Entity Relationship Modelling Top down approach –who or what do we need to store data about? Steps involved: –identify the entities about which the system needs to store data –for each entity, list its attributes –for each entity, identify the attribute(s) that will uniquely identify it –identify the relationships between the entities –define the type and optionality of each relationship –update the data dictionary with definitions of the entities –check each attribute against the data dictionary and data flow diagrams

Data and MetaData Data is the value that you expect to be held in an attribute. –e.g. My name is Patricia O’Byrne and I lecture Software Engineering Meta-data is the description of the data: –Lecturer Name: Patricia O’Byrne –Subject: Software Engineering –The meta-data is consistent for all subjects Attributes are meta-data. If you can’t put a value on an attribute, it is data, not meta-data!

Tables and Documents Most systems, especially manual ones, are based around forms. A form is not an entity - i.e. not relational. We expect forms to be ‘unnormalised’ – i.e. unsuitable for immediate use as an entity. If any of your entities are forms, they need more attention. You need to normalise forms to uncover the Entity Relationship Diagram.

Resolving ‘many to many’ relationships Often with many to many relationships there is information associated with the relationship that cannot be attached sensibly to either entity. e.g. STUDENT and SUBJECT which entity should hold the “mark”? –attaching data to one or other entity results in repeating data

Resolution Many to many relationships are always resolved into two one to many entities with the introduction of a new entity called a link (or weak ) entity –e.g. RESULTS entity is the link between STUDENT and SUBJECT entities The primary key of a link entity is always the combination of the primary keys of the entities in the relationship it is resolving.

Data Dictionary conventions for data models –entities written in capitals where there is more than one word, words are joined with underscore ‘_’ character –data items that are primary keys are underlined –foreign keys are marked with asterisk *

Defining entities and attributes Pick out nouns from the script. –External entities –Process names –Internal entities –Attributes –Values Eliminate all except the entities and attributes. Try to ensure that you are not treating an external entity or business actor as a stored entity.

Describing Entities An entity is denoted by all capital letters, followed in parentheses by a list of its attributes: STUDENT(StudentNumber, StudentName, CourseCode, CourseYear, HomeAddress, PhoneNumber) Entities should not repeat, each one should be different.

An entity or not an entity? An entity is an entity if –Information needs to be kept on it –The information that needs to be held on it Is not part of another entity Probably consists of more than one data item E.g. –A STUDENT entity is described by the following: –StudentNumber, Name, CourseCode, CourseYear, HomeAddress, PhoneNumber.

Attributes An attribute if –It describes the entity, but has little value outside the context of the entity. –An attribute has a datatype and a length. –E.g. StudentName can have a value of “Mary O’Reilly”. It has a datatype of string and a maximum length of 30.

Candidate key A candidate key is an attribute, or group of attributes that can uniquely define an individual occurrence of an entity. Let’s assume we have an entity of customers. Consider the following conversation: –“Do you know John Brown?” –“Yes, I do. He lives in Hill St.” –“No, I mean the other John Brown, he lives over in Valley St.” To distinguish between the two people, both the name and address of the person is required. Therefore, the name is NOT a candidate key. The name and address MAY be a candidate key, unless… –“Do you mean John Brown Senior, or John Brown Junior?”

Candidate key contd. Candidate keys may be simple: –StudentNumber is a candidate key for STUDENT. Or compound: –CustomerName + CustomerAddress + CustomerDateOfBirth is a candidate key for the CUSTOMER entity. If the candidate key is not suitable, a key may be imposed: –Let’s give our CUSTOMER a CustomerNumber. That would be much shorter to store and to retrieve.

Foreign Key An attribute is a foreign key if –It describes another entity in a single or compound data item –Its purpose is to point to another entity. E.g. the CourseCode attribute in the STUDENT entity. –Another entity called COURSE must exist, where CourseCode is the primary key.

Maybe not in the schema at all? An EXTERNAL entity if –It provides information to the system / takes information from the system, but no information about it is stored. This has no place in your ERD. –An example of this would be someone who browses on the Internet without registering or buying. While they are essential to the running of the process, no data is kept on them.