Dr. Chaitali Basu Mukherji

Slides:



Advertisements
Similar presentations
Entity-Relationship (ER) Modeling
Advertisements

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.
Systems Development Life Cycle
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 7.1.
Systems Analysis Requirements structuring Process Modeling Logic Modeling Data Modeling  Represents the contents and structure of the DFD’s data flows.
Entity Relationship Diagrams Basic Elements and Rules.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Entity Relationship Diagrams
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 7.1.
Data Modeling Introduction. Learning Objectives Define key data modeling terms –Entity type –Attribute –Multivalued attribute –Relationship –Degree –Cardinality.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Modern Systems Analysis and Design Third Edition
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Entity-Relationship Design
Trisha Cummings.  Most people involved in application development follow some kind of methodology.  A methodology is a prescribed set of processes through.
Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
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.
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.
ระบบฐานข้อมูลขั้นสูง (Advanced Database Systems) Lecturer AJ. Suwan Janin Phone:
PowerPoint Presentation for Dennis, Wixom, & Roth Systems Analysis and Design, 3rd Edition Copyright 2006 © John Wiley & Sons, Inc. All rights reserved..
1 Data Modeling : ER Model Lecture Why We Model  We build models of complex systems because we cannot comprehend any such system in its entirety.
ITEC224 Database Programming
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Database Systems: Design, Implementation, and Management Ninth Edition
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter 6 Structuring.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Essentials of Systems Analysis and Design Fourth Edition Joseph S. Valacich Joey F.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Rob and Coronel Adapted for INFS-3200.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Database Systems. Entity Relationship Diagram How to Develop an ERD? Typically you will start with a case study or perhaps a logical model of the system.
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
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.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
EntityRelationshipDiagrams. Entity Relationship Models The E-R (entity-relationship) data model views the real world as a set of basic objects (entities)
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
2 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Data Models Why data models are important About the basic data-modeling.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
ENTITY RELATIONSHIP DIAGRAM. Objectives Define terms related to entity relationship modeling, including entity, entity instances, attribute, relationship.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
Data Modeling Using the Entity- Relationship (ER) Model
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Data Modeling Using the ERD
Logical Database Design and the Rational Model
Database Development Lifecycle
Systems Analysis and Design
CS311 Database Management system
Database Management system
CS 174: Server-Side Web Programming February 12 Class Meeting
Chapter 4 Entity Relationship (ER) Modeling
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
IT 244 Database Management System
Chapter 7 Structuring System Requirements: Conceptual Data Modeling
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
CMPE/SE 131 Software Engineering March 7 Class Meeting
Lecture 10 Structuring System Requirements: Conceptual Data Modeling
Presentation transcript:

Dr. Chaitali Basu Mukherji Data Modelling Dr. Chaitali Basu Mukherji

Data Modeling Concepts A data model is a simply a diagram that describes the most important “things” in your business environment from a data-centric point of view.

Data Model for representation of a part of a real world it is an abstraction of the reality : ignores unnecessary details represents operational data about real world events, entities, activities, etc. model may be at various levels depending of requirements : logical or physical external, conceptual, internal

Data Model…… a good model is easy to understand has a few concepts permits top-down specifications model offers concepts, constructs and operations must capture meaning of data (data semantics) which help us in interpreting and manipulating data

Data Model…… semantics captured through data types, inter-relationships and data integrity constraints uniqueness existence dependence restrictions on some operations such as insertions, deletions

Example : Data Model in a PL data structuring concepts data field/variable data groups and arrays Record/structure : unit of file i/o file : collection of records

Example : Data Model in a PL … Operations file level : open, close record level : read next/random write next/random field level : computations no inter-file and inter-record relationships no constraints except primary key for indexed files

Why We Model We build models of complex systems because we cannot comprehend any such system in its entirety Need to develop a common understanding of the problem and the solution Cannot afford a trial-and-error approach to communicate the desired structure and behavior of our systems to visualize and control system’s architecture to understand the system we are building, often exposing opportunities for simplification and reuse

Why We Model to manage risk The choice of which model we use has a profound influence on how a problem is attacked and how a solution is shaped No single model is sufficient; every complex system is best approached through a set of independent models Every model may be expressed at different levels of fidelity The best models are connected to reality

Conceptual Data Modeling Data can be modeled at many levels, including the conceptual, logical and physical level. Conceptual Data Modeling is a very high level representation of organizational data. The purpose is to show the basic building blocks for the organization, i.e. the entities and rules about their meaning and interrelationships Logical data modeling adds more detail to conceptual modeling, but is still concerned only with how the organization/business uses data. Physical data modeling adds more detail, but is especially concerned with the actual physical implementation of the data.

Gathering Information Two perspectives Top-down Data model is derived from an intimate understanding of the business Bottom-up Data model is derived by reviewing specifications and business documents

Four Types of Data Models Current System Proposed System Project-Level E-R diagram for system being replaced Covers just data needed in the project’s application Enterprise-Level An E-R diagram for the whole database from which data for the application system being replaced is drawn An E-R diagram for the whole database from which the new application’s data are extracted

Sample conceptual data model diagram

Business Principles Business Principles IT Principles Organizational consensus Data integrity Implementation efficiency User friendliness Operational efficiency IT Principles Scalability Compliance with IT standards

Primary steps Problem definition Do I need data warehouse? What specific problems will it solve? What are my available resources (time, money, and personnel)? What criteria will I use to measure success? Should I outsource all, some, or none of the development and operation? Am I upgrading an existing system, converting from a legacy system, or developing from scratch?

Primary steps Requirement analysis Group and "bubble-up" requirements. Generate a prioritized requirements table listing the requirement, where it came from, the success criteria, and priority. Keep this table high-level. A table with a dozen requirements will be much easier to manage than one with hundreds. Produce a detailed development schedule including hardware, software, personnel, documentation, and reviews. Include outsourcing requirements and long lead-time items. Get a sign-off of the requirements, resource allocation, and schedule from top management before you go any further.

Primary steps Requirement analysis Clearly state the problem(s) you wish to solve. Identify all data sources and formats. Identify the users of the completed system. Formulate a specific budget - time, money, personnel. Ask identified users to specifically state what they expect the system to do. Ask management to specifically state their success criteria Separate their requirements from their "desirements." Only design to requirements. The enhancement phase is where you address the "desirements."

Primary steps Conceptual design Design and prototyping Information or data modeling First level – ER Modeling Second level – Normalization Design and prototyping Rapid prototyping Structured development

Primary steps Development and Documentation Test and Review Deployment and Training Operation Enhancement Help Desk

Objectives of ER Model Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship and cardinality, and primary key. Describe the entity modeling process. Discuss how to draw an entity relationship diagram. Describe how to recognize entities, attributes, relationships, and cardinalities.

Database Model A database can be modeled as: a collection of entities, relationship among entities. Database systems are often modeled using an Entity Relationship (ER) diagram as the "blueprint" from which the actual data is stored — the output of the design phase.

Entity Relationship Diagram (ERD) ER model allows us to sketch database designs ERD is a graphical tool for modeling data. ERD is widely used in database design ERD is a graphical representation of the logical structure of a database ERD is a model that identifies the concepts or entities that exist in a system and the relationships between those entities

Purposes of ERD An ERD serves several purposes The database analyst/designer gains a better understanding of the information to be contained in the database through the process of constructing the ERD. The ERD serves as a documentation tool. Finally, the ERD is used to communicate the logical structure of the database to users. In particular, the ERD effectively communicates the logic of the database to users.

Components of an ERD 2. Relationship 3. Cardinality 4. Attribute An ERD typically consists of four different graphical components: 1. Entity 2. Relationship 3. Cardinality 4. Attribute

Classification of Relationship Optional Relationship An Employee may or may not be assigned to a Department A Patient may or may not be assigned to a Bed Mandatory Relationship Every Course must be taught by at least one Teacher Every mother have at least a Child

Cardinality Constraints Express the number of entities to which another entity can be associated via a relationship set. Cardinality Constraints - the number of instances of one entity that can or must be associated with each instance of another entity. Minimum Cardinality If zero, then optional If one or more, then mandatory Maximum Cardinality The maximum number

Cardinality Constraints (Contd.) For a binary relationship set the mapping cardinality must be one of the following types: One to one A Manager Head one Department and vice versa One to many ( or many to one) An Employee Works in one Department or One Department has many Employees Many to many A Teacher Teaches many Students and A student is taught by many Teachers

Cardinality Constraints (Contd.)

Cardinality Constraints Example In our model, we wish to indicate that each school may enroll many students, or may not enroll any students at all. We also wish to indicate that each student attends exactly one school. The following diagram indicates this optionality and cardinality:

Cardinality Constraints Example (Contd.)

Developing an ERD The process has ten steps: 1. Identify Entities 2. Find Relationships 3. Draw Rough ERD 4. Fill in Cardinality 5. Define Primary Keys 6. Draw Key-Based ERD 7. Identify Attributes 8. Map Attributes 9. Draw fully attributed ERD 10. Check Results

A Simple Example A company has several departments. Each department has a supervisor and at least one employee. Employees must be assigned to at least one, but possibly more departments. At least one employee is assigned to a project, but an employee may be on vacation and not assigned to any projects. The important data fields are the names of the departments, projects, supervisors and employees, as well as the supervisor and employee number and a unique project number.

Identify entities One approach to this is to work through the information and highlight those words which you think correspond to entities. A company has several departments. Each department has a supervisor and at least one employee. Employees must be assigned to at least one, but possibly more departments. At least one employee is assigned to a project, but an employee may be on vacation and not assigned to any projects. The important data fields are the names of the departments, projects, supervisors and employees, as well as the supervisor and employee number and a unique project number. A true entity should have more than one instance

Find Relationships Aim is to identify the associations, the connections between pairs of entities. A simple approach to do this is using a relationship matrix (table) that has rows and columns for each of the identified entities.

Find Relationships (Contd.) Go through each cell and decide whether or not there is an association. For example, the first cell on the second row is used to indicate if there is a relationship between the entity "Employee" and the entity "Department".

Identified Relationships Names placed in the cells are meant to capture/describe the relationships. So you can use them like this A Department is assigned an employee A Department is run by a supervisor An employee belongs to a department An employee works on a project A supervisor runs a department A project uses an employee

Draw Rough ERD Draw a diagram and: Place all the entities in rectangles Use diamonds and lines to represent the relationships between entities. General Examples

Drawing Rough ERD (Contd.)

Drawing Rough ERD (Contd.)

Drawing Rough ERD (Contd.)

Fill in Cardinality Supervisor Department Employee Project Each department has one supervisor. Department Each supervisor has one department. Each employee can belong to one or more departments Employee Each department must have one or more employees Each project must have one or more employees Project Each employee can have 0 or more projects.

Fill in Cardinality (Contd.) The cardinality of a relationship can only have the following values One and only one One or more Zero or more Zero or one

Cardinality Notation

Cardinality Examples

ERD with cardinality

Examples

ERD for Course Enrollment

ERD for Course Registration

Rough ERD Plus Primary Keys

Identify Attributes In this step we try to identify and name all the attributes essential to the system we are studying without trying to match them to particular entities. The best way to do this is to study the forms, files and reports currently kept by the users of the system and circle each data item on the paper copy.

Identify Attributes Cross out those which will not be transferred to the new system, extraneous items such as signatures, and constant information which is the same for all instances of the form (e.g. your company name and address). The remaining circled items should represent the attributes you need. You should always verify these with your system users. (Sometimes forms or reports are out of date.) The only attributes indicated are the names of the departments, projects, supervisors and employees, as well as the supervisor and employee NUMBER and a unique project number.

Map Attributes For each attribute we need to match it with exactly one entity. Often it seems like an attribute should go with more than one entity (e.g. Name). In this case you need to add a modifier to the attribute name to make it unique (e.g. Customer Name, Employee Name, etc.) or determine which entity an attribute "best' describes. If you have attributes left over without corresponding entities, you may have missed an entity and its corresponding relationships. Identify these missed entities and add them to the relationship matrix now.

Map Attributes (Contd.)

Draw Fully Attributed ERD

Check ERD Results Look at your diagram from the point of view of a system owner or user. Is everything clear? Check through the Cardinality pairs. Also, look over the list of attributes associated with each entity to see if anything has been omitted.