Database Design: ER Modelling

Slides:



Advertisements
Similar presentations
SQL -I Reading: C&B, Chaps 6, 7, 8 & 9. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn The basic concepts and principles.
Advertisements

Dept. of Computing Science, University of Aberdeen1 Writing SELECT SQL Queries Nigel Beacham based on materials.
Logical Database Design Reading: C&B, Chap 17. Dept. of Computer Science, University of Aberdeen2 In this lecture you will learn What is logical database.
Relational Model Reading: C&B, Chap 2, 3 & 4. Dept. of Computing Science, University of Aberdeen 2 In this lecture you will learn The concept of Model.
Access Control & Views Reading: C&B, Chap 7. Dept of Computing Science, University of Aberdeen2 In this lecture you will learn the principles of object.
Database Design: ER Modelling (Continued)
File Organization & Indexing Reading: C&B, Ch 18 & 23.
1 SA0951a Entity-Relationship Modelling. 2 What is it about? ER model is used to show the Conceptual schema of an organisation. Independent of specific.
Database Systems: Design, Implementation, and Management Tenth Edition
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
CSC271 Database Systems Lecture # 22. Summary: Previous Lecture  Applying Database SDLC on DreamHome  Database planning  System definition  Requirements.
Systems Analysis Requirements structuring Process Modeling Logic Modeling Data Modeling  Represents the contents and structure of the DFD’s data flows.
Chapter 6 Methodology Conceptual Databases Design Transparencies © Pearson Education Limited 1995, 2005.
Lecture Eleven Entity-Relationship Modelling
Lecture Fourteen Methodology - Conceptual Database Design
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Methodology Conceptual Database Design
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
LOGICAL DATABASE DESIGN
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
CSC271 Database Systems Lecture # 21. Summary: Previous Lecture  Phases of database SDLC  Prototyping (optional)  Implementation  Data conversion.
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Computer System Analysis Chapter 10 Structuring System Requirements: Conceptual Data Modeling Dr. Sana’a Wafa Al-Sayegh 1 st quadmaster University of Palestine.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Relational Model & Relational Algebra. 2 Relational Model u Terminology of relational model. u How tables are used to represent data. u Connection between.
ITEC224 Database Programming
Methodology - Conceptual Database Design Transparencies
Methodology Conceptual Databases Design
9/14/2012ISC329 Isabelle Bichindaritz1 Database System Life Cycle.
Chapter 5 Entity–Relationship Modeling
Chapter 11 (I) CIS458 Sungchul Hong. Chapter 11 - Objectives How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated.
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
1 Chapter 15 Methodology Conceptual Databases Design Transparencies Last Updated: April 2011 By M. Arief
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
1/26/2004TCSS545A Isabelle Bichindaritz1 Database Management Systems Design Methodology.
Methodology: Conceptual Databases Design
DATABASE MGMT SYSTEM (BCS 1423) Chapter 5: Methodology – Conceptual Database Design.
Team Dosen UMN Database Design Connolly Book Chapter
Conceptual Database Design
Entity-Relationship Modeling Based on Chapter 12.
Chapter 8 Methodology - Conceptual Database Design Chapter 15 in Textbook.
1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
CS 3630 Database Design and Implementation. Assignment 1 2 What is 3630?
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 13 Normalization Transparencies Last Updated: 08 th May 2011 By M. Arief
Part4 Methodology of Database Design Chapter 07- Overview of Conceptual Database Design Lu Wei College of Software and Microelectronics Northwestern Polytechnical.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Modelling Methodologies Chapter 16, 17, 18. Modeling Methodologies2 Database Design Physical DB design Logical DB design Conceptual DB design Hardware.
1 Database Systems Entity Relationship (E-R) Modeling.
CSC271 Database Systems Lecture # 23. Summary: Previous Lecture  Database design using ER modeling  Concepts of ER model  Entities  Relationships.
B. Information Technology (Hons.) CMPB245: Database Design Physical Design.
DBMS ER model-2 Week 6-7.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
The Relational Model Lecture #2 Monday 21 st October 2001.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
CS 3630 Database Design and Implementation
Databases and Database Management Systems Chapter 9
Entity-Relationship Modeling
Conceptual Database Design
Entity-Relationship Modeling
Presentation transcript:

Database Design: ER Modelling Reading: C&B, Chaps 10, 11 & 12

In this lecture you will learn Database system development lifecycle Phases of database design Relational Database design Introduction to ER Modelling Dept of Computing Science, University of Aberdeen

Database System Lifecycle Database Planning – project planning System definition – user views and context Requirements collection and analysis Several fact-finding techniques (C&B, Chap 10) Database design DBMS selection (optional) Application design Prototyping (optional) Implementation Data conversion and loading Testing Operational maintenance Dept of Computing Science, University of Aberdeen

Dept of Computing Science, University of Aberdeen Database Design Process of fitting a database solution to client’s requirements Client’s requirements will never be mathematically ‘crisp’ So, not possible to fit a unique solution mathematically Our approach use semi-formal methods to arrive at an initial design Use iterative refinement to improve the design Design process is subjective and creative Each of us may propose a different design for the same client requirements Dept of Computing Science, University of Aberdeen

Phases of Database Design Database design achieved in three phases Conceptual – model data independent of all physical considerations Logical – refine and map conceptual model onto relational model (or some other database model such as object-oriented ) Physical – map logical model onto a specific DBMS (say, MySql) In simple domains where we have good understanding of the domain data, we may not use the three phase method We open MSAccess (or any other RDBMS) and directly define tables and their links For real world applications, you should use the three phase method A good design facilitates efficient storage and retrieval of data Dept of Computing Science, University of Aberdeen

Relational Database Design In this course, the logical design is based on relational model (see lecture 2) This means, given a conceptual design of a domain (such as DreamHome) , logical design involves Designing a collection of connected (linked) tables in which the domain data is stored and The table design facilitates SQL to work with these tables Insert, update, delete and select operations must be efficiently run In this course, we will focus on Conceptual and Logical phases of database design These two phases decide the relational table structure and the links among them Dept of Computing Science, University of Aberdeen

Database Design – DreamHome Example Conceptual design - Modelling data in the domain (as shown in the slide #8) What are the individual data concepts? Staff – name, position etc Properties – address, rant etc Branches - address Clients – name, contact etc How are these items related? E.g. staff manage properties and staff work at a branch Logical Design - Given the conceptual design, logical design involves (as shown in the slide #9) Designing individual tables such as Staff and Branch and Link these tables using foreign keys (to mark the relationships) Physical Design – Given the logical design, physical design involves (as shown in the slide #9) Implementing the logical design in MSAccess (a specific RDBMS) Dept of Computing Science, University of Aberdeen

Conceptual Design of DreamHome PropertyForRent ---------------------- PropertyNo Branch --------------- BranchNo Owns Owner ---------------- OwnerNo ViewedBy Client --------------- ClientNo Registration Staff --------------- StaffNo Manages Note: Many Details not shown to avoid clutter Dept of Computing Science, University of Aberdeen

Logical (Relational) Design of DreamHome Link (Relationship) Table Table Dept of Computing Science, University of Aberdeen

Observations from DreamHome Design Two levels of design Conceptual design (slide #8) Logical (Relational) design (slide #9) Relational design uses information from conceptual design Without the information from conceptual level relational design is not possible Tables at relational level are obtained from both entities and relationships (formally introduced later) at conceptual level Staff table derived from Staff Concept from conceptual design Viewing table derived from ViewedBy relationship from conceptual design Links between tables at relational level are obtained from relationships at conceptual level Dept of Computing Science, University of Aberdeen

Dept of Computing Science, University of Aberdeen Conceptual Design Model data independent of DBMS, application programs, programming languages, hardware platform etc. We want to have a common understanding of how data is viewed and used by different people in client’s organization Understanding the structure and meaning of data in the domain Each user’s perspective of the data Nature of the data itself, independent of its physical representations Use of data across user views The output model may well be used for other purposes Such as offering a paper based data management!!!! Conceptual design = ER Modelling Dept of Computing Science, University of Aberdeen

Dept of Computing Science, University of Aberdeen ER Modelling Models a domain of discourse Central Ideas Domains are made up of entities Relationships link associated Entities Entities and relationships have properties called attributes Certain attributes are special, call them primary keys and alternate keys Need integrity constraints to preserve domain consistency Deliverables ER Models - documented diagrammatically Data dictionary Documentation is an important component of ER modelling Dept of Computing Science, University of Aberdeen

Dept of Computing Science, University of Aberdeen Entity Type A group of objects with the same properties, which are identified by the enterprise as having an independent existence not a formal definition Different designers may identify different entities Entity Occurrence – a uniquely identifiable object of an entity type Can have physical existence For example, Staff, Property, Customer Can have conceptual existence For example, Viewing and Inspection Dept of Computing Science, University of Aberdeen

Entity type - Diagrammatic representation A rectangle labelled with the name of the entity First letter of each word in the entity name is uppercase E.g., PropertyForRent Normally an entity type is named using a ‘noun’ or ‘noun phrase’ PropertyForRent Dept of Computing Science, University of Aberdeen

Dept of Computing Science, University of Aberdeen Relationship Types A set of meaningful associations among entity types For example, ‘Branch’ and ‘Staff’ can be associated with a relationship ‘Has’ Relationship occurrence – a uniquely identifiable association, which includes one occurrence from each participating entity type Dept of Computing Science, University of Aberdeen

Relationship type – diagrammatic representation Shown as a line connecting the associated entity types, labelled with the name of the relationship First letter of each word in the entity name is uppercase Normally a relationship is named using a ‘verb’ or ‘verb group’ The direction in which the relationship makes sense is marked using an ‘arrow’ Has Staff Branch ‘Branch has staff’ Dept of Computing Science, University of Aberdeen

Degree of Relationship type The number of participating entity types in a relationship Relationships can be classified based on their degree into Binary – relationship with two participants Ternary – relationship with three participants Quaternary – relationship with four participants Dept of Computing Science, University of Aberdeen

Diagrammatic representation of relationships with degree > 2 A diamond is used to represent ternary and quaternary relationships Registers Staff Branch Client ‘Staff registers a client at a branch’ Dept of Computing Science, University of Aberdeen

Dept of Computing Science, University of Aberdeen Attributes A property of an entity or a relationship type For example, Staff has 4 attributes StaffNo Name Position Salary Dept of Computing Science, University of Aberdeen

Diagrammatic Representation of attributes Entity rectangle is divided into two parts Upper part displays the entity name Lower part displays the list of attributes Normally an attribute is named using an ‘noun’ or ‘noun group’ Primary key should be the first in the list Staff StaffNo {PK} Name Position Salary Dept of Computing Science, University of Aberdeen

Dept of Computing Science, University of Aberdeen Conclusion Database design is an iterative process ER Modelling is industry standard Learning ER Modelling involves Learning to identify entities, relationships, attributes from requirements specification and other client supplied documents Documenting in a standard form for effective communication More ER Modelling next week Dept of Computing Science, University of Aberdeen