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.

Slides:



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

Data Modeling. What are you keeping track of? You begin to develop a database by deciding what you are going to keep track of. Each thing that you are.
ENTITY RELATIONSHIP MODELLING
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Accounting System Design
Revised by Ivor Perry Sept Introduction to Data Modelling.
Data Modelling II. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis Feasibility Maintenance.
Tutorial 1 Entity Relationship Modelling. Entities and what they mean One-to-many Header-Items Invoice/ Invoice Items Customer/ Customer- Branch Bidirectional.
Agenda for Week 1/31 & 2/2 Learn about database design
Data modelling uses two main techniques Entity relationship (E-R) modelling: a top- down approach Normalisation: a bottom-up approach.
Systems Analysis and Design in a Changing World, 6th Edition
Database Design Concepts Info1408
Case study Lisa’s Bookstore IST210.
Copyright ©2014 Pearson Education, Inc. Chapter 3 Requirements and Business Rules Chapter3.1.
Modern Systems Analysis and Design Third Edition
Mapping ERM to relational database
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,
Practical tips for creating entity relationship diagrams (ERDs) Chitu Okoli Associate Professor in Business Technology Management John Molson School of.
Entity Relationship Modeling
Data Modeling Using the Entity-Relationship Model
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
ZEIT2301 – Database Design Entity-Relationship Diagrams
Data Modeling using Entity Relationship Diagramming (ERD)
Chapter 8: Systems analysis and design
COMM 226 Practical tips for creating entity relationship diagrams (ERDs) Chitu Okoli Associate Professor in Business Technology Management John Molson.
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
CSE 441: Systems Analysis & Design
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Practice of ER modeling
Use Case modelling 1. Objectives  Document user requirements with a model  Describe the purpose of an actor and a use case  Construct a use case model.
Driving School Database
Entity Relationship Diagram (ERD) 22 February 2011.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
1 Relational Database Development Alison Taylder Consultant ITC-ILO, Turin 25 th November 2004.
© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart1 of 96 C HAPTER 17 Special Topics in REA Modeling for the.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 2 This material was developed by Oregon Health & Science.
Database Design Principles – Lecture 3
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Section 08 (a)ER Modelling In Practice1 HSQ - DATABASES & SQL And Franchise Colleges 08 (a) ER Modelling In Practice QUICKHIRE Car Company.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 7 Data Modeling with Entity Relationship Diagrams
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.
Use Case Diagrams.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Mr C Johnston ICT Teacher
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Chapter 3 Requirements and Business Rules Copyright © 2012 Pearson Education, Inc. Publishing as Prentice HallChapter3.1.
Conceptual Design to Logical Design Lecture 4. Aims  To introduce Business Rules  To identify what a Business Rule is  To Introduce Business Operations.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
1 CS 430 Database Theory Winter 2005 Lecture 3: A Fifty Minute Introduction to Data Modeling.
DATA MODELING AND ENTITY-RELATIONSHIP MODEL II IST 210: Organization of Data IST210 1.
Year 12 > 13 Applied GCE ICT Unit 7 Using Database Software.
Let try to identify the conectivity of these entity relationship
ER MODEL Lecture 3.
Overview of Entity‐Relationship Model
GCSE Computing Databases.
MIS2502: Data Analytics Relational Data Modeling
CHAPTER 2 - Database Requirements and ER Modeling
Entity-Relationship Diagram (ERD)
Database Management system
Database Management system
Presentation transcript:

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 and reference them to corresponding terms in table design  Select suitable entities and attributes for a given case study  Describe and select suitable primary keys 2

 We need to hold data to meet user requirements. e.g. names, addresses, stock quantities, appointment times etc.  We could hold all this data in a single table  What would be the disadvantages ?  A data model provides us with a way of visually deciding how we might break up the data into chunks so that the data items in a chunk all relate to the same object or entity  A data model may be produced using a technique known as entity modelling 3

 The relationships between these entities are then shown on a diagram and we can see the structure of the proposed database  The diagram is often called an entity relationship diagram (ERD)  The data model consists of the ERD and the accompanying documentation  A model in this sense is a selection of features that describe a certain aspect of a system 4

 An entity is anything of significance about which we wish to hold information  Entities can be real world objects such as Employee, Chair and Car intangible objects such as Purchase Order, Current Account, and Seat Reservation. These entities should contain all the information that we need to hold in the database 5

 The requirements of the system are first analysed to find what is significant and what is not  Entities are described by a set of attributes  An attribute is a data item that can be used to describe the state of an entity 6

Example of an Entity 7 entity name attributes

An entity will allow us to generate an occurrence or a particular example of an entity Brenda Wooltorton Yes

Every customer would have values for most, if not all, of these attributes Each entity can potentially give rise to any number of occurrences 9

 Entity becomes Table  Attribute becomes Field  Occurrence becomes Record 10

11

12

13

Understand the problem domain Conduct an analysis of the user’s present system and future requirements Use interviews, existing documentation and observation 14

 Be clear about the context  In this case the context is the selection and booking of courses for staff members  Names of the possible entities must be expressed in the singular start with an upper case letter  Picking out the nouns is one way of making up a list of possible entities 15

 Staffordshire Free University employs a large number of staff who need to keep up to date with a whole variety of subjects. The staff may work in different departments within the university. A system is required that will keep track of bookings made by staff members to go on various training courses. The courses may be internal or external. 16

 Each course, whether internal or external, occurs on a number of occasions and staff members are free to choose which offering they wish to take. Each course has a title and it is required to know when they start. Each course offering for the same course will last for the same time and this must be recorded. The course offerings may be at any number of different locations and will only run if there are a minimum number of students booked onto the course offering. Each course offering also has a maximum number of students who are allowed to be booked onto it. 17

 The staff are allowed to browse the different courses available and then select the particular course they wish to go on and the offering that suits them best. When a staff member makes a booking the system should record the date on which it was made.  Detail of the staff member booking a course offering include the name, job title, date of birth, date appointed and department name.  The database should allow the training officer in SFU to see which members of staff are booked onto which courses 18

The list here would be: Staffordshire Free UniversityStaffSubject DepartmentTraining CourseNumber of occasions Course OfferingCourse TitleStart Date BookingCourse DurationLocation Minimum Student NumberMaximum Student NumberStudent Booking DateStaff NameJob Title Date of BirthDate AppointedDepartment Name Training Officer 19

 Must be something about which we wish to store information in the context of the case study  There must be more than one occurrence of each entity  Make sure you have an entity and not an attribute. If it is an entity there will be more than one attribute you will want to have for it. It is very common to need to decide if you have an attribute or an entity. 20

CConsider if the entity name is vague. It should be specific CCall an entity by one name TThink of two or three attributes it might contain that we need to operate the system DDon’t include the name of the company for which you are performing the data model. The entire E-R diagram is representing the company DDon’t expect to get a full list of entities immediately 21

 Staff Member  Course  Booking  Course Offering We need to remember that we may add to this list of entities later. 22

 Each attribute can take on only one value for any one occurrence of that entity  If you are putting in an attribute with an ‘s’ on the end – stop and think. This may be an entity in its own right 23

 Each attribute name should be in the singular  If attribute is plural then you must create another entity where you can place that attribute in its singular form  The chosen name should be specific  e.g. choose quantity in stock or order quantity or re-order quantity rather than quantity 24

 Check that you can choose a suitable value for that attribute for a given occurrence  An attribute should be placed in one entity only  Choose the most natural home for its placement  Resist the temptation to put an attribute in more than one place e.g. customer ID could be placed in the Customer or Order entity 25

 Don’t include attributes whose values may be determined from other attribute values  e.g.For example don’t include Total Value if it is simply the sum of a number of Sub-totals that you are already keeping  Never use the term ‘details’  Check against the case study for omissions 26

27 Entities for Staffordshire Free University example

 a course offering apparently has no details of the course title  a booking does not know for which person or course it is made! 28

 Uniquely identify each occurrence of an entity by reference to the values of its attributes  Choose one or more attributes such that if we know their value we can uniquely identify that occurrence  One or more attributes that perform such a function are known as the primary key of that entity 29

 Sometimes a primary key already exists  Choose the minimum number of attributes possible to form the primary key  If Customer ID is a unique number such that no two customers can have identical numbers then Customer ID could be a primary key 30

 Combinations of other attributes would not guarantee a way of uniquely identifying a customer  Underline the attribute(s) forming the primary key 31

32 Entities for SFU with attributes and primary keys

We may relax our rule of placing an attribute in only one entity if we need it in another entity to form part of a primary key See Course ID for the Course entity and Course ID for Course Offering 33

 Can we uniquely identify some small items ?  We need to identify the name of the entity as a type of object e.g. we might call an entity Stock Item Type and have attributes of Item #, Item Description and Quantity in Stock Two occurrences then might be: Item #Item DescriptionQuantity in Stock ” steel nail mm bolt43 34

 Entities are often chosen from nouns in requirements specification  Test to see if an entity has two attributes (or more) that we need to know to make our system work  Don’t put any single attribute in more than one place 35

 Software System Development – A Gentle Introduction 3rd Edition, Britton & Doake, 2003, McGraw Hill (Essential reading) ISBN