Entity Relationship Modelling zDatabase Development zA Relational model zIts E-R equivalent zE-R notation zDeveloping an E-R Model zE-R difficulties.

Slides:



Advertisements
Similar presentations
Systems Development Life Cycle
Advertisements

1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Database Design (Data Modeling) DCO11310 Database Systems and Design By Rose Chang.
Entity-Relationship Model and Diagrams (continued)
Data Modelling. EAR model This modelling language allows a very small vocabulary: Just as English has nouns, verbs, adjectives, pronouns.., EAR models.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
OO - Lecture 4 Tutorial Review Associations Inheritance of Functions Polymorphism.
Database – Part 2a Dr. V.T. Raja Oregon State University.
Seminar #1 – Refreshing databases concepts and SQL CM036: Advanced Databases1 Seminar 1: Revisiting Databases and SQL Purpose To refresh basic concepts.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
1 Lecture 8 The Data Model. Database Design Process 1) i.d. users views and requirements 2) all requirements are mapped into relational model which is.
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
o At the end of this lesson, you will be able to:  Describe the life-cycle development phases  Discuss the theoretical and physical aspects of a relational.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
1 Translating E/R Diagrams into Relational Schemas.
Copyright  Oracle Corporation, All rights reserved. I Introduction.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Q1: What is DBMS and explain its architecture. Q2: Explain Data Independence in detail. Q3: What is database user and explain the types of database user.
Concepts and Terminology Introduction to Database.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
HNDComputing – DeMontfort University  DeMontfort University 2011 Database Fundamentals wk2 Database Design ConceptsDatabase Design Concepts Database Design.
Databases From A to Boyce Codd. What is a database? It depends on your point of view. For Manovich, a database is a means of structuring information in.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Lecture 8 Database Theory & Practice (2) : The Relational Data Model UFCEKG-20-2 Data, Schemas & Applications.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
MSc IT UFIE8K-15-M Data Management Prakash Chatterjee Room 3P16
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
CS370 Spring 2007 CS 370 Database Systems Lecture 4 Introduction to Database Design.
Database Management System Quiz 1. A company needs to store information about: the employees identified by EmpNo, Name, Salary and Phone; departments.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
Chapter 2 THE DATABASE ENVIRONMENT Introduction to Databases: ANSI-SPARC Architecture Data independence Data models Relational database concepts Introduction.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
Description and exemplification of entity-relationship modelling.
More SQL Data Management Topics zIntegrity Constraints zOuter Join zUnion.
WXGE 6101 DATABASE CONCEPTS & IMPLEMENTATIONS. Lesson Overview The Relational Model Terminology of relational model. Properties of database relations.
Seminar 10: OODB Design (Self-Study)
advanced data modeling
ITN MySQL Database Programming 1 Lecture 3 :Database Analysis and Design (I) ITN 170 MySQL Database Programming.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
Lecture 5 Entity Relationship Modeling. Topics Real things and descriptions Example for the workshop Implementation into RDBMS and XML ER models as abstract.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Relational State Assertions These slides.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Collection Operators These slides are.
COP-5725 Practice Exercises
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Collection Operators These slides are.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
DATA MODELING AND DATABASE DESIGN DATA MODELING AND DATABASE DESIGN Part 2.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Inner Joins These slides are licensed.
The Entity-Relationship Model (Chapter 3 Additional Notes – Part a) Laku Chidambaram W.P. Wood Professor of MIS University of Oklahoma.
Data Modeling AND ER MODELS.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
INF385T: Information Modeling — Class 11 Relational Database Design from ER Models Presented November 2 Karen Wickett,
Entity-Relationship Model and Diagrams (continued)
ERD’s REVIEW DBS201.
Entity Relationship Diagrams
Lecture 16 : The Relational Data Model
INFO/CSE 100, Spring 2006 Fluency in Information Technology
Lecture 16 : The Relational Data Model
Presentation transcript:

Entity Relationship Modelling zDatabase Development zA Relational model zIts E-R equivalent zE-R notation zDeveloping an E-R Model zE-R difficulties

Database Development zFrom UoD + requirement z To implemented system zHow to structure the activity? zDon’t do everything at once zSequence decisions - Users first, technology last zRelational model too close to technology

Why not Relational schema directly? zWhich DBMS will be used? yOracle - 7, 8, 9, Jet, MySQL? zMaybe another Data model altogether? yOLAP, Object oriented, Logical, XML zRelational schema too far from the user - ysome concepts are not user terms xe.g. primary keys, foreign keys ymany tables in schema are artifacts xe.g. resolving many-many relationships ysome relationships not explicit in schema x e.g. employee and salgrade, no self-managers

A Relational Schema zDept (Deptno, Dname, Loc) zEmp(Empno, ename, job, mgr, hiredate, sal, comm, deptno) zSalgrade(grade, losal, hisal) zOnly tables and columns, but columns used for different purposes - ywhat are they?

Different kinds of column zPrimary key - Underline zForeign Key - Italic zAttribute

zDept (Deptno, Dname, Loc) zEmp(Empno, ename, job, mgr, hiredate, sal, comm, deptno) zSalgrade(grade, losal, hisal)

zMore abstract - not specific to relational data model zEntity - cf- Table zRelation - cf Primary Key/Foreign key zAttribute - cf most columns zSometimes called an EAR model Entity Relation model

E-R <> Relational Schema zRelational Schema >>> E-R Model yWe will first use E-R models as a way to represent a Relational Schema, using the example database from the SQL workbook zUod >>> E-R model >>> Schema yWe will then use an E-R model as a step in translating user requirments into a database schema

E-R model of Employee DB zEntity: Department yAttributes: Name, Location zEntity: Employee yAttributes: Name, Job, Hiredate, MonthlySalary, Commission zEntity: SalaryGrade: yAttributes: Grade, losal, hisal zRelationship: yManages (Employee, set of Employee) zRelationship: yEmploys(Department,set of Employees)

E-R Diagrams zE-R models are often represented as diagrams. zDiagrams help to show Relationships clearly zNo single notation, so ensure you use a legend to explain your notation

E-R diagrams zEntity zRelationship z 1 to a set of (many) zAttribute Department name Employee

E-R instance diagram E1 E2E5E3 E4 D1 D2

Entity Questions zEntities are complex things of interest in the UoD zEntity corresponds to Table in Relational schema

Entities Department Employee SalaryGrade

Attribute questions zIs EmpNo an attribute yIf EmpNo already used in UoD, eg by an existing system, then it is an attribute yIf it is not of interest to the user, and just used to link tables, then ignore it

Attributes Department Name Location Employee Name Job AnnualSalary Commission Hiredate SalaryGrade Hisal Losal Grade

Employs relationship zMeaning - department currently employs - note that this changes over time zConstraints yevery employee must work for exactly one department ya department may employ zero, one or more employees yCardinality is 1 to 0.N

Relationships - Employs Department Name Location Employee Name Job AnnualSalary Commission Hiredate SalaryGrade Hisal Losal Grade employs

Manages relationship zEvery employee except the top guy has exactly one manager zEmployees manage zero, one or more employees zalso za manager cannot manage themselves - directly or indirectly

Relationship - Manages Department Name Location Employee Name Job AnnualSalary Commission Hiredate SalaryGrade Hisal Losal Grade employs manages

Relationship Employee-grade zIn the database this was ‘computed’ or ‘derived’ by finding the grade such that ylosal <= sal <= hisal zWe can show such relationships in E-R (but more common in an Object model)

Department Name Location Employee Name Job AnnualSalary Commission Hiredate SalaryGrade Hisal Losal Grade employs manages

From UoD to E-R model zWhich Entities? zEntity - Attribute - Relationship ambiguity zEntity or Instance of Entity zMany to Many relationships

Which Entities? z‘Nouns in description of Uod become entities in E-R’ zIs Job an entity zIs Location an entity zIs information required to be held about the term - details of responsibilities for Job, full address for Location.

Entity - Attribute - Relationship ambiguity zSuppose we need to know if an employee is married yAttribute - married - True/False yAttribute - name of spouse yRelationship - married to (another employee) yEntity - marriage, with date of marriage, date of divorce etc

Entity or Instance of Entity zEach Entity is a class of entity instances - yemployee entity has (14) entity instances zBook / Copy problem yBook has a title, author, ISBN yCopy has an accession no, location, condition, onloan Book Copy

Many to Many relationships zSuppose employees move between departments, so that over a period of time an employee is employed by several departments Department Employee employs

Department Employee Employment Hiredate Many to Many >> 2 One to Many

Next week zLecture :Normalization yChapter 23 zTutorial : E-R modelling exercises