CSC 742 Database Management Systems



Similar documents
Chapter 8 The Enhanced Entity- Relationship (EER) Model

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E)

2. Conceptual Modeling using the Entity-Relationship Model

Chapter 2: Entity-Relationship Model. E-R R Diagrams

IV. The (Extended) Entity-Relationship Model

DATABASE DESIGN. - Developing database and information systems is performed using a development lifecycle, which consists of a series of steps.

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

The Entity-Relationship Model

Conceptual Design Using the Entity-Relationship (ER) Model

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst

Modern Systems Analysis and Design

The Entity-Relationship Model

Chapter 2: Entity-Relationship Model

COMP 378 Database Systems Notes for Chapter 7 of Database System Concepts Database Design and the Entity-Relationship Model

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

Lecture 6. SQL, Logical DB Design

XV. The Entity-Relationship Model

Chapter 3. Data Modeling Using the Entity-Relationship (ER) Model

Chapter 10. Practical Database Design Methodology. The Role of Information Systems in Organizations. Practical Database Design Methodology

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

Lecture 12: Entity Relationship Modelling

Unit 2.1. Data Analysis 1 - V Data Analysis 1. Dr Gordon Russell, Napier University

Data Analysis 1. SET08104 Database Systems. Napier University

Database Design Methodology

not necessarily strictly sequential feedback loops exist, i.e. may need to revisit earlier stages during a later stage

Foundations of Information Management

Requirement Analysis & Conceptual Database Design. Problem analysis Entity Relationship notation Integrity constraints Generalization

Database Design Process

Databases and BigData

Database Design Process

The Relational Model. Why Study the Relational Model? Relational Database: Definitions. Chapter 3

7.1 The Information system

Review: Participation Constraints

Relational Schema Design

The E-R èentity-relationshipè data model views the real world as a set of basic objects èentitiesè and

Formal Engineering for Industrial Software Development

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Exercise 1: Relational Model

IT2305 Database Systems I (Compulsory)

Entity-Relationship Model

Enhanced-ER Data Model

14 Databases. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

three Entity-Relationship Modeling chapter OVERVIEW CHAPTER

Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases

Part 7: Object Oriented Databases

A brief overview of developing a conceptual data model as the first step in creating a relational database.

Data Modeling. Database Systems: The Complete Book Ch ,

CS 377 Database Systems. Database Design Theory and Normalization. Li Xiong Department of Mathematics and Computer Science Emory University

IT2304: Database Systems 1 (DBS 1)

ER modelling, Weak Entities, Class Hierarchies, Aggregation

Foundations of Information Management

Normal Form vs. Non-First Normal Form

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

We know how to query a database using SQL. A set of tables and their schemas are given Data are properly loaded

Winter Winter

How To Write A Diagram

RELATIONSHIP STRENGTH

SQL DDL. DBS Database Systems Designing Relational Databases. Inclusion Constraints. Key Constraints

Schema Refinement, Functional Dependencies, Normalization

BCA. Database Management System

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #5: En-ty/Rela-onal Models- - - Part 1

Lesson 8: Introduction to Databases E-R Data Modeling

Lecture Notes INFORMATION RESOURCES

Database Design Methodology

Reverse Engineering of Relational Databases to Ontologies: An Approach Based on an Analysis of HTML Forms

Normalization. Reduces the liklihood of anomolies

Information Systems Modelling Information Systems I: Databases

Designing a Database Schema

ER & EER to Relational Mapping. Chapter 9 1

Answers to Review Questions

Part A: Data Definition Language (DDL) Schema and Catalog CREAT TABLE. Referential Triggered Actions. CSC 742 Database Management Systems

Umbrello UML Modeller Handbook

A Tool for Generating Relational Database Schema from EER Diagram

Functional Dependency and Normalization for Relational Databases

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

Conceptual Design: Entity Relationship Models. Objectives. Overview

There are five fields or columns, with names and types as shown above.

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

Database Design and the E-R Model

Agile Software Development

BİL 354 Veritabanı Sistemleri. Entity-Relationship Model

Database Design. Adrienne Watt. Port Moody

Database Systems. Session 3 Main Theme. Enterprise Data Modeling Using The Entity/Relationship (ER) Model. Dr. Jean-Claude Franchitti

Fundamentals of Database Design

Database Design and Normalization

Semantics of UML class diagrams

Study Notes for DB Design and Management Exam 1 (Chapters 1-2-3) record A collection of related (logically connected) fields.

Chapter 5: Logical Database Design and the Relational Model Part 2: Normalization. Introduction to Normalization. Normal Forms.

Chapter 10. Functional Dependencies and Normalization for Relational Databases


The Entity-Relationship Model

Data Modeling Basics

Transcription:

CSC 742 Database Management Systems Topic #4: Data Modeling Spring 2002 CSC 742: DBMS by Dr. Peng Ning 1 Phases of Database Design Requirement Collection/Analysis Functional Requirements Functional Analysis High-Level Transaction Spec. Application Program Design Transaction Implementation Database Requirements Conceptual Design Conceptual Schema Logical Design Logical Schema Physical Design Application Program Internal Schema Spring 2002 CSC 742: DBMS by Dr. Peng Ning 2 1

Part A: Entity-Relationship Model Spring 2002 CSC 742: DBMS by Dr. Peng Ning 3 What is ER Model About? Structure of the data Entities and relationships between (among) entities Constraints Conditions that the entities and relationships must satisfy. Key constraint Domain constraint Structural constraint Spring 2002 CSC 742: DBMS by Dr. Peng Ning 4 2

ER Concepts Entities Relationships Attributes Spring 2002 CSC 742: DBMS by Dr. Peng Ning 5 Attributes Atomic vs. composite Single- vs. multivalued Stored vs. derived Complex Attributes Spring 2002 CSC 742: DBMS by Dr. Peng Ning 6 3

Null Values Need Meanings not applicable unknown: missing or questionable existence Spring 2002 CSC 742: DBMS by Dr. Peng Ning 7 Entities Entity type (intension): e.g., Employee or Dept A collection of entities that have the same attributes Entity instance: e.g., Fred or Payroll Entity set (extension): e.g., {Fred, Bob,...} Spring 2002 CSC 742: DBMS by Dr. Peng Ning 8 4

Keys An intension corresponds to all possible extensions Superkey: a set of attributes that are unique for an entity type (i.e., for all possible extensions) Key: a minimal superkey fewer attributes won't be unique An entity type may have multiple keys Spring 2002 CSC 742: DBMS by Dr. Peng Ning 9 Relationships Relationship types: e.g., works-in Relationship instances: e.g., Fred works-in Payroll Spring 2002 CSC 742: DBMS by Dr. Peng Ning 10 5

Relationship Properties A relationship type associates entity types typically binary or ternary recursive may have attributes Spring 2002 CSC 742: DBMS by Dr. Peng Ning 11 Entity Types Participate in relationship types Have roles in those relationship types Spring 2002 CSC 742: DBMS by Dr. Peng Ning 12 6

Cardinality Cardinality constraints: number of relationship instances in which an entity instance may feature 1:1 1:N M:N Spring 2002 CSC 742: DBMS by Dr. Peng Ning 13 Achtung! Don't confuse 1:N with N:1 Some notations, especially for O-O modeling, write the cardinalities differently Spring 2002 CSC 742: DBMS by Dr. Peng Ning 14 7

Inferring Cardinalities We can construct paths between entity types These paths represent relationships composed from series of the existing relationships Their cardinalities can be inferred Spring 2002 CSC 742: DBMS by Dr. Peng Ning 15 Fan Traps Situations where the inferred, i.e., implied, cardinality is weaker than the actual cardinality Spring 2002 CSC 742: DBMS by Dr. Peng Ning 16 8

Participation Participation constraints: whether each entity instance must feature in some relationship instance total: yes partial: no Spring 2002 CSC 742: DBMS by Dr. Peng Ning 17 Chasm Traps When the composed relationship, i.e., path, has a weaker participation constraint than is actual Spring 2002 CSC 742: DBMS by Dr. Peng Ning 18 9

Weak Entity Types No key of its own attributes Must participate in a total relationship Another participant of the relationship becomes the owner Key = owner's key + partial key Spring 2002 CSC 742: DBMS by Dr. Peng Ning 19 Summary of ER Diagram Notations Entity Weak Entity Relationship Identifying Relationship Attribute Key Attribute Multi-valued Attribute Spring 2002 CSC 742: DBMS by Dr. Peng Ning 20 10

Summary of ER Diagram Notations Composite Attribute Derived Attribute E1 R E2 1 N E1 R E2 Total Participation of E2 in R Cardinality Ratio 1:N for E1:E2 In R R (min,max) E Structural Constraint (min,max) on Participation of E in R Spring 2002 CSC 742: DBMS by Dr. Peng Ning 21 Part B: Enhanced ER Model Spring 2002 CSC 742: DBMS by Dr. Peng Ning 22 11

Why Do We Need EER ER modeling is sufficient for representing many database schemas for traditional database applications. Recent applications require additional semantic data modeling concepts Class/subclass relationship Type inheritance Specialization and generalization. Spring 2002 CSC 742: DBMS by Dr. Peng Ning 23 Subclass-Superclass Subclasses: Further refinement (grouping) of a (super)class Attributes are inherited Class/subclass relationship is different from the relationship in ER modeling. Spring 2002 CSC 742: DBMS by Dr. Peng Ning 24 12

Specialization Specialization: The process of defining a set of subclasses of an entity type Top-down conceptual refinement Allows us to Define a set of subclasses of an entity type Establish additional specific attributes with each subclass Establish additional specific relationship types between each subclass and other entity types or other subclasses. Spring 2002 CSC 742: DBMS by Dr. Peng Ning 25 Generalization Generalization: creating a superclass by combining classes bottom-up conceptual synthesis Can be viewed as the inverse of the specialization process. Spring 2002 CSC 742: DBMS by Dr. Peng Ning 26 13

Classification Predicate-based: when a defining predicate determines the subclass of which a given instance is member Attributed-based: when the predicate applies only on an attribute User-defined: when the user decide the subclass membership Disjoint vs. overlapping Total vs. partial Spring 2002 CSC 742: DBMS by Dr. Peng Ning 27 Constraints on Specialization/Generalization Disjointness constraint The subclasses of the specialization must be disjoint. Specified by (d) Otherwise, the subclasses may overlap. Specified by (o) Spring 2002 CSC 742: DBMS by Dr. Peng Ning 28 14

Constraints on Specialization/Generalization Completeness constraint Total Specialization Partial Specialization Disjointness and completeness constraints are independent. Superclass identified from generalization is usually total. Spring 2002 CSC 742: DBMS by Dr. Peng Ning 29 Rules Delete from superclass subclasses delete from all Insert into predicate-based superclass insert where predicate holds Insert into total superclass insert into a subclass can't reasonably be done unless a predicate is specified Spring 2002 CSC 742: DBMS by Dr. Peng Ning 30 15

Structure Hierarchy: single inheritance Lattice: multiple inheritance Shared subclass Attribute inheritance Single inheritance: trivial Multiple inheritance Spring 2002 CSC 742: DBMS by Dr. Peng Ning 31 Union Types Category A subclass of the Union of some entity types A category has two or more super-classes Different from generalization. Spring 2002 CSC 742: DBMS by Dr. Peng Ning 32 16

Aggregation Combining objects to form a composite object. Three types of aggregations Aggregate attribute values of an object to form the object Represent an aggregation relationship as an ordinary relationship Combine objects that are related by a relationship into a higher-level aggregate object. Spring 2002 CSC 742: DBMS by Dr. Peng Ning 33 Association Associate objects from several independent classes. Not quite aggregation because deleting an entity instance doesn't destroy the instances it is composed of Spring 2002 CSC 742: DBMS by Dr. Peng Ning 34 17