1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
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.
Transform an ER Model into a Relational Database Schema
Chapter 2.1 V3.1 Napier University Dr Gordon Russell
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
ENTITY RELATIONSHIP MODELLING
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
System Analysis - Data Modeling
Agenda for Week 1/31 & 2/2 Learn about database design
The Relational Database Model:
WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code.
Lecture 3 :Database Analysis and Design (II)
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Database Design Concepts Info1408
Database – Part 2a Dr. V.T. Raja Oregon State University.
Entity/Relationship Modelling
APPENDIX C DESIGNING DATABASES
Mapping ERM to relational database
Entity-Relationship Design
Oracle Academy -Week 1-.
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.
Entity-Relationship Modeling I The cautious seldom err. Confucius.
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
ZEIT2301 – Database Design Entity-Relationship Diagrams
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
BIS 360 – Lecture Six (Part 2) Conceptual Data Modeling (Chapter 10 and partial Chapter 12)
Entity Relationship Diagram (ERD) 22 February 2011.
Introduction to Database Systems Mapping ER Models to Relational Schemas Irvanizam Zamanhuri, M.Sc Informatics (Computer Science) Study Program Syiah Kuala.
G057 - Lecture 02 Introduction To Database System Concepts Mr C Johnston ICT Teacher
Database Systems Lecture # 7 8 th Feb, Conceptual and Logical Design Person buys Product name pricenamessn Conceptual Model: Relational Model: (plus.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003, 2004.
G045 Lecture 09 ERD Diagrams (Entity Relationship Diagrams) Mr C Johnston ICT Teacher
Database Design Principles – Lecture 3
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
IS 475/675 - Introduction to Database Design
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Database Fundamentals Lecture 4 Useful website for MySQL download language.com/workshops/Default.asp ?workshop=21.
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.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
Description and exemplification of entity-relationship modelling.
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.
Database Design – Lecture 4 Conceptual Data Modeling.
Database Basics BCIS 3680 Enterprise Programming.
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
Entity/Relationship Modelling. Entity Relationship Modelling In This Lecture Entity/Relationship models Entities and Attributes Relationships Attributes.
Mr C Johnston ICT Teacher
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 Modeling
Entity/Relationship Modelling
Let try to identify the conectivity of these entity relationship
Case Studies: Data Modeling
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Tables and Their Characteristics
Database Design – Lecture 4
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
Entity relationship diagrams
MIS2502: Data Analytics Relational Data Modeling
Data Modeling for Database Design 2
MIS2502: Data Analytics Relational Data Modeling
IT 244 Database Management System
Database Management system
Database Management system
Presentation transcript:

1

 An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2

 A database will contain “a logically coherent collection of data with some inherent meaning”[1]  In this module we are dealing with modelling to support relational databases – such as Access, MYSQL, Oracle  In a relational database, data is stored in relations (tables)  The purpose of the data model is to show how the data is related 3

 The process model provides information about the processes you are dealing with – to help you build the data model  The data model provides information about the data enabling you to get from this:  (student enrolment form) 4

5

 The data model includes the ER diagram but also includes other elements – covered in later lectures  An ERD on its own is not a complete data model 6

 Student ref no  Award details Award title Award code Level Home faculty Intake month Award completion date  Personal Details Family name Forename(s) Title Gender DOB Previous Family name (if any0 Work contact address Term time address Post code Home address Postcode Tel Mobile phone Postcode Tel Private address  There are at least 84 possible items of information on the student enrolment form  Most of these items would need to be broken down further to store in a database  Data modelling is the tool that lets you order this information 7

 Yes – but only if you do it properly  A correct data model will give you: A diagrammatic representation of the way in which entities are related Data dictionary information about the entities and the attributes and the relationships Properly organised data A basis for design 8

 is an item of data  ‘The time is 10:41’ is a piece of information  Data is raw, unstructured facts  Information is data organised to provide meaning 9

 An entity Is something about which you wish to store information STUDENT is an entity  An attribute is information about an entity STUDENT DOB is information about the entity STUDENT  It is better to talk about an occurrence of an entity.  We have an entity STUDENT. We then store information about specific students – Mr John Doe and Ms Jane Doe. Each of these is an occurrence of the entity STUDENT  One entity may have many occurrences of an entity – you would expect this – one table may have many rows; there are many students at the university 10

 Data modelling starts by identifying the entities  An entity is usually a noun – Customer, Order, Delivery would be entities  You can use the process model as the starting point for identifying entities – a store on the DFD holds information about something 11  The DFD example used in Dave’s lecture include a data store  Since you want to store information about staff, reasonable that this will be an entity on the data model

 If the descriptions for the data flow have been done correctly, we will know what ‘staff details’ means  Assume it covers: Name, Address, Age, Position 12

 How would you tell one member of staff from another?  How useful is ‘address’?  What is the problem with ‘age’?  Get in the habit now of always putting data into atomic form  Look at what the attributes are really describing 13

 Why isn’t there a process model?  A good place to start is by identifying the nouns: A Student enrols on a Module taught by a Tutor The convention is that an entity is always described in the singular, and starts with a capital What does Module mean? (if you have done a process model, you will already have the answer to this question) 14

15 Always state assumptions

 3 entities have been identified: STUDENT MODULE TUTOR  Start by identifying the primary key for each entity 16

 Uniquely identifies each occurrence of an entity; is not null  Which means that: A primary key cannot be duplicated. You cannot have 2 Tutors identified by the same PK Cannot be left blank Is essential - in a relational database, every occurrence of an entity must have a PK 17

 Last Name?  No, because the PK must be unique not only now but in the future.  Module?  OK as long as a tutor only teaches on one module but – Tutors teach on many modules Module details and tutors change from time to time  The obvious answer is a Tutor_ID 18

 Must uniquely identify the occurrence of the entity  Must not be likely to change (another reason for not using Name)  Does not usually contain meaningful data so will tend to be numeric or alphanumeric 19

 Possible relationships are: 1:M 1:1  Not allowed: M:M also written as N:M  In this system, a tutor may teach on many modules, but a module is only ever taught by 1 tutor 20

21

 Think of it as the primary key of another entity that you use to link two entities 22

23 PK FK Attributes Optional Mandatory Cardinality

24  What happens if you do this?

 Many students study many modules  A M:M or N:M relationship cannot be implemented in a relational database  Since you can’t change reality, you must change the data model 25

 Whenever you have or appear to have a N:M relationship, look carefully at the entities  Many students enrol on many modules  1 student can enrol on 1 or more or no modules  A module can be studied by 1 or more or no students  Hidden in this scenario is the idea of enrolment 26

27

 A Weak (or Link or Intersection) entity depends for its existence on other entities.  A student can choose whether to enrol or not, but an enrolment cannot exist without the student  Participation is always mandatory on the Weak entity side 28