21/02/2011. Chapter 4: Entity Relationship (ER) Data Modelling. Introduction to ER Modelling

Similar documents
Your organization has a Class B IP address of Before you implement subnetting, the Network ID and Host ID are divided as follows:

Baan Service Master Data Management

The following example will help us understand The Sampling Distribution of the Mean. C1 C2 C3 C4 C5 50 miles 84 miles 38 miles 120 miles 48 miles

1 Computing the Standard Deviation of Sample Means

Infinite Sequences and Series

In nite Sequences. Dr. Philippe B. Laval Kennesaw State University. October 9, 2008

Properties of MLE: consistency, asymptotic normality. Fisher information.

I. Chi-squared Distributions

Lesson 17 Pearson s Correlation Coefficient

Z-TEST / Z-STATISTIC: used to test hypotheses about. µ when the population standard deviation is unknown

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

MATH 083 Final Exam Review

ODBC. Getting Started With Sage Timberline Office ODBC

PUBLIC RELATIONS PROJECT 2016

Center, Spread, and Shape in Inference: Claims, Caveats, and Insights

Math C067 Sampling Distributions

1 Correlation and Regression Analysis

Predictive Modeling Data. in the ACT Electronic Student Record

How To Solve The Homewor Problem Beautifully

.04. This means $1000 is multiplied by 1.02 five times, once for each of the remaining sixmonth

Elementary Theory of Russian Roulette

CS103A Handout 23 Winter 2002 February 22, 2002 Solving Recurrence Relations

Taking DCOP to the Real World: Efficient Complete Solutions for Distributed Multi-Event Scheduling

Non-life insurance mathematics. Nils F. Haavardsson, University of Oslo and DNB Skadeforsikring

*The most important feature of MRP as compared with ordinary inventory control analysis is its time phasing feature.

CS103X: Discrete Structures Homework 4 Solutions

Multiplexers and Demultiplexers

3 Basic Definitions of Probability Theory

CS100: Introduction to Computer Science

CHAPTER 3 DIGITAL CODING OF SIGNALS

CS100: Introduction to Computer Science

Voluntary Life and AD&D Insurance

Ekkehart Schlicht: Economic Surplus and Derived Demand

BaanERP 5.0c. EDI User Guide

Hypothesis testing. Null and alternative hypotheses

Configuring Additional Active Directory Server Roles

Week 3 Conditional probabilities, Bayes formula, WEEK 3 page 1 Expected value of a random variable

Repeating Decimals are decimal numbers that have number(s) after the decimal point that repeat in a pattern.

GOOD PRACTICE CHECKLIST FOR INTERPRETERS WORKING WITH DOMESTIC VIOLENCE SITUATIONS

One-sample test of proportions

Engineering Data Management

Hypergeometric Distributions

Rainbow options. A rainbow is an option on a basket that pays in its most common form, a nonequally

Agency Relationship Optimizer

PSYCHOLOGICAL STATISTICS

FOUNDATIONS OF MATHEMATICS AND PRE-CALCULUS GRADE 10

FIBONACCI NUMBERS: AN APPLICATION OF LINEAR ALGEBRA. 1. Powers of a matrix

Domain 1: Designing a SQL Server Instance and a Database Solution

Domain 1 - Describe Cisco VoIP Implementations

Life Insurance: Your Blueprint for Wealth Transfer Planning. Producer Guide to Private Split Dollar Arrangements. Your future. Made easier.

Best of security and convenience

Designing Incentives for Online Question and Answer Forums

THE ARITHMETIC OF INTEGERS. - multiplication, exponentiation, division, addition, and subtraction

The Big Picture: An Introduction to Data Warehousing

How to set up your GMC Online account

1. Introduction. Scheduling Theory

Exam 3. Instructor: Cynthia Rudin TA: Dimitrios Bisias. November 22, 2011

Dynamic House Allocation

5: Introduction to Estimation

Confidence Intervals for One Mean

Theorems About Power Series

G r a d e. 2 M a t h e M a t i c s. statistics and Probability

Life & Disability Insurance. For COSE Employer Groups with 10+ Employees

Chapter 7: Confidence Interval and Sample Size

Soving Recurrence Relations

Example 2 Find the square root of 0. The only square root of 0 is 0 (since 0 is not positive or negative, so those choices don t exist here).

Modified Line Search Method for Global Optimization

Disability Income Insurance

Department of Computer Science, University of Otago

Confidence Intervals. CI for a population mean (σ is known and n > 30 or the variable is normally distributed in the.

A Meta-Plugin for Bespoke Data Management in WordPress

A GUIDE TO LEVEL 3 VALUE ADDED IN 2013 SCHOOL AND COLLEGE PERFORMANCE TABLES

Incremental calculation of weighted mean and variance

RUT - Development manual

Enhancing Oracle Business Intelligence with cubus EV How users of Oracle BI on Essbase cubes can benefit from cubus outperform EV Analytics (cubus EV)

Asymptotic Growth of Functions

Sequences and Series

OMG! Excessive Texting Tied to Risky Teen Behaviors

7.1 Finding Rational Solutions of Polynomial Equations

(VCP-310)

CREATIVE MARKETING PROJECT 2016

Practice Problems for Test 3

Investing in Stocks WHAT ARE THE DIFFERENT CLASSIFICATIONS OF STOCKS? WHY INVEST IN STOCKS? CAN YOU LOSE MONEY?

One Goal. 18-Months. Unlimited Opportunities.

Escola Federal de Engenharia de Itajubá

RISK TRANSFER FOR DESIGN-BUILD TEAMS

Safety Requirements engineering and Proof of implementation

THE REGRESSION MODEL IN MATRIX FORM. For simple linear regression, meaning one predictor, the model is. for i = 1, 2, 3,, n

Time Value of Money. First some technical stuff. HP10B II users

leasing Solutions We make your Business our Business

Lesson 15 ANOVA (analysis of variance)

Determining the sample size

Listing terms of a finite sequence List all of the terms of each finite sequence. a) a n n 2 for 1 n 5 1 b) a n for 1 n 4 n 2

Flood Emergency Response Plan

Chapter 7 - Sampling Distributions. 1 Introduction. What is statistics? It consist of three major areas:

Analyzing Longitudinal Data from Complex Surveys Using SUDAAN

5 Boolean Decision Trees (February 11)

Measures of Spread and Boxplots Discrete Math, Section 9.4

Permutations, the Parity Theorem, and Determinants

Business Rules-Driven SOA. A Framework for Multi-Tenant Cloud Computing

Transcription:

CA28 Itroductio to Databases otes Chapter 4: Etity Relatioship (ER) Data odellig Itroductio ER Defiitios ER otatio Relatioships ER Examples Itroductio to ER odellig A Etity relatioship model (ER) is a abstract ad coceptual represetatio of data. ER modellig is a DB modellig method, used to produce a type of coceptual schema of a system. Diagrams created by this process are called ER diagrams. Sequece: Coceptual data model (i.e. ER) is, at a later stage (called logical desig), mapped to a logical data model, (e.g. relatioal model); this is mapped to a physical model i physical desig. ER odel used to iterpret, specify & documet requiremets for DBs irrespective of DBS beig used. Plaig/ Aalysis Coceptual Data odel (ER Diagram) Logical DB Desig Logical Data odel (Relatioal, ormal Form) Physical DB Desig Physical Data odel (Tables with P., F. Keys etc) Implemetatio ER Defiitios Etity (Istace): A istace of a physical object i the real world. Etity Class: Group of objects of the same type. E.g. Etity Class, Etities Joh, Trish etc Attributes: Properties of Etities that describe their characteristics. Types: Simple: Attribute that is ot divisible, e.g. age. Composite: Attribute composed of several simple attributes, e.g. address (house umber, street, district) ultiple : Attribute with a set of possible values for the same etity, e.g. Phoe (home, mobile etc.) or email Key: Uiquely Ids the Etity e.g. PPS, Csis o. Value Set (or domai): Each simple attribute associated with a VS that may be assiged to that attribute for each idividual etity, e.g. age = iteger, rage [8, 65] Age Address Phoe Worker House o. Street District PPS (c) arti Crae 20

CA28 Itroductio to Databases otes Relatioships:. Are bi directioal (ie ca be put 2 ways) 2. Degree: biary (i.e. ivolve oly two etities), terary (i.e. ivolve three participatig etities). 3. Cardiality: Etity types may be liked i more tha oe way. 4. ay have properties (attribs). 5. Ca be Recursive. ER Defiitios (cot d) 2. Lecturer Lectures Lecturer Biary Recommeds Textbook Course Terary 4. Price : a arries Woma Bar sells Beers :m m Lecturer Teaches s 5. Perso arries :m 3. m Erols o Courses Keys/Key Attributes Some defiitios: Super Key Set of attributes uiquely idetifyig a row For SP {S#,P#,QTY} or {S#,P#} Cadidate Key (Irreducible) combiatio of attributes which is a uique idetifier withi a table. For SP {S#,P#} Primary Key Oe of the cadidate keys. For SP {S#,P#} Alterate Key The cadidate key(s) (if ay) ot chose as the primary key. Foreig Key A (combiatio of) attribute(s) i oe relatio whose value(s) are required to equal i the primary key of aother relatio. S PK for S (FK for SP) S# Same Status City S Smith 20 Paris S2 Joes 0 Paris PK for P S3 Blake 30 Rome (FK for SP) P# Pame Colour Weight City P P ut Red 2 Lodo P2 Bolt Gree 7 Paris P3 Screw Blue 27 Rome P4 Screw Red 4 Lodo S# P# QTY S P 300 SP S P2 200 S P3 400 S2 P 300 S2 P2 400 S3 P2 200 PK for SP ER Example : Etity With Attributes A studet a studet umber (idetifyig), a ame, a address (with street umber, street ad district) ad several phoe umbers umber ame House o. Address Street Phoe District 2 (c) arti Crae 20

CA28 Itroductio to Databases otes ER Example 2: Relatioship Cardiality Ratios Ordiary otatio Husbad Divorces Wife Ows Borrows Crow s Feet otatio Ows Borrows Relatioship Cardiality Ratio Questios Patiet Has GP Performs Operatio Specialise I Disease eedle Ijected Ito Patiet Recursive Relatioship Examples arries Perso Likes Perso ote Use of roles i recursive relatioship Supervises Cardiality Ratios Supervisor Supervises Supervisee 3 (c) arti Crae 20

CA28 Itroductio to Databases otes The followig are ot part of core or lowest commo deomiator otatio: Weak Etity: ore ER Defiitios Depedets Oe which caot be id ed by attributes aloe E.g. book editios; depedet childre, ID Depedet Etity: Block Appartmets Special case of Weak Etity where id icludes etity id it depeds o E.g. Idividual id appartmets i a block Block: Idetifier Bldgame, Appartmet: Idetifier {Bldgame,Appto} Derived Attribute Attribute whose values are geerated from other attributes E.g. AcctBalace=TotalCredit TotalDebit ore ER Defiitios (cot d) Total/Partial Participatio Depedets Partial: Etity s Existece does t require existece of associated etity i a relatioship. E.g. Etity does t require Depedets Total: Etity s Existece requires that of associated etity ote: Does t have to be W.E. to require Total Participatio e.g. Works o Project is Total o both sides. Exteded ER odel Sub /Super types: Used to deote is a relatioship: is either Hourly or Salaried Salary ame PPS Salaried Hourly Wage ER Example 3: A Hospital Case Patiets are treated i a sigle ward by the doctors assiged to them. Usually each patiet will be assiged a sigle doctor, but i rare cases they will have two. Heathcare assistats also atted to the patiets, a umber of these are associated with each ward. Patiet See By See By Treated I Assistat Ward 4 (c) arti Crae 20

CA28 Itroductio to Databases otes ER Example 4: Football Club A football club a ame ad a groud ad is made up of players. A player ca play for oly oe club ad a maager, represeted by his ame maages a club. A footballer a registratio umber, ame ad age. A club maager also buys players. Each club plays agaist each other club i the league ad matches have a date, veue ad score. Veue Date Score Plays ame Reg. um Age Groud Club Plays For Player ame Buys ame aages aager ER Example 5: Bus Compay A Bus Compay ows a umber of busses. Each bus is allocated to a particular route, although some routes may have several busses. Each route passes through a umber of tows. Oe or more drivers are allocated to each stage of a route, which correspods to a jourey through some or all of the tows o a route. Some of the tows have a garage where busses are kept ad each of the busses are idetified by the registratio umber ad ca carry differet umbers of passegers, sice the vehicles vary i size ad ca be sigle or double decked. Each route is idetified by a route umber ad iformatio is available o the average umber of passegers carried per day for each route. Drivers have a employee umber, ame, address, ad sometimes a telephoe umber. Etities (bold face) Bus Compay ows busses ad will hold iformatio about them. Route Buses travel o routes ad will eed described. Tow Buses pass through tows ad eed to kow about them Driver Compay employs drivers, persoel will hold their data. Stage Routes are made up of stages Garage Garage houses buses, ad eed to kow where they are. ER Example 5: Bus Compay (cot d) Etities ad their Relatioships (Cardiality) A bus is allocated to a route ad a route may have several buses. Bus Route (m:) is serviced by A route comprises of oe or more stages. Route Stage (:m) comprises Oe or more drivers are allocated to each stage. Driver Stage (m:) is allocated A stage passes through some or all of the tows o a route. Stage Tow (m:) passes through A route passes through some or all of the tows Route Tow (m:) passes through Some of the tows have a garage Garage Tow (:) is located i A garage keeps buses ad each bus oe `home' garage Garage Bus (m:) is garaged 5 (c) arti Crae 20

CA28 Itroductio to Databases otes ER Example 5: Bus Compay (cot d) Attributes (key attributes) Bus (reg o, make, size,deck, o pass) Route (route o,avg pass) Driver (emp o, ame, address, tel o) Tow (ame) Stage (stage o) Garage (ame, address) ER Example 5: Bus Compay (cot d) deck reg_o make size o_pass route_o ave_pass m BUS is serviced by ROUTE is garaged stage_o ame address GARAGE STAGE m passed thro is allocated emp_o tel_o DRIVER is located i TOW ame address ame ER Example 6: Uiversity Database A lecturer, idetified by his or her umber, ame ad room umber, is resposible for orgaisig a umber of course modules. Each module a uique code ad also a ame ad each module ca ivolve a umber of lecturers who deliver part of it. A module is composed of a series of lectures ad because of ecoomic costraits ad commo sese, sometimes lectures o a give topic ca be part of more tha oe module. A lecture a time, room ad date ad is delivered by a lecturer ad a lecturer may deliver more tha oe lecture. s, idetified by umber ad ame, ca atted lectures ad a studet must be registered for a umber of modules. We also store the date o which the studet first registered for that module. Fially, a lecturer acts as a tutor for a umber of studets ad each studet oly oe tutor. 6 (c) arti Crae 20

CA28 Itroductio to Databases otes ER Example 6: Uiversity Database (cot d) Etities ad their Attributes (key) Lecturer (umber, ame, Office), (umber, ame) odule (Code, ame), Lecture (Room, Date, Time) Etities ad their Relatioships (Cardiality) italics A lecturer is resposible for orgaisig a umber of course modules Lecturer odule (:) is resposible for Each module ca ivolve a umber of lecturers who deliver part of it. Lecturer odule (:) lectures A odule is composed of a series of Lectures ad Lectures o a give topic ca be part of more tha oe odule. odule Lecture (:) is part of A Lecture is delivered by a Lecturer ad a lecturer may deliver more tha oe lecture. Lecturer Lecture (:) delivers s, ca atted Lectures Lecture (:) atted ad a must be registered for a umber of odules odule (:) registers (Attribute: Date) Lecturer acts as a tutor for a umber of s ad each oly oe tutor Lecturer (:) tutors ER Example 6: Uiversity Database (cot d) umber ame Office umber ame Lecturer Plays For Date Register Lectures Resp. For Atteds Delivers odule Part of Lecture Code ame Room Time Date 7 (c) arti Crae 20