Docsity

Introduction to Database Design: Entity-Relationship Model and Conceptual Design, Lecture notes of Database Management Systems (DBMS)

Partial preview of the text

Download Introduction to Database Design: Entity-Relationship Model and Conceptual Design and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity!

2– 1 Introduction to Database Design ( 1. 1. 1 ) CSC 370 [email protected]

Introduction to Database Design

UVic C SC 370 Dr. Daniel M. German Department of Computer Science May 5, 2004 Version: 1.1.

Overview

✥ What are the steps in designing a database? ✥ What is the entity-relationship (ER) model? ✥ How does UML related to the ER model? Chapter 2 of textbook

Database Design

Database design can be divided in six major steps: ✥ Requirements analysis ✥ Conceptual Database design (mostly done using the ER model) ✥ Logical Database design ✥ Schema refinement ✥ Physical Database Design ✥ Application and Security Design

ER diagram

ER Diagram : ✥ an approximate description of the data, ✥ constructed through a subjective evaluation of the information, ✥ that was collected through the requirements analysis phase.

Example of an Entity

name

ssn

lot

Employees

2– 8 Introduction to Database Design ( 1. 1. 1 ) CSC 370 [email protected]

Relationships

✥ A relationship is an association among two or more entities ✥ A set of similar relationships is called a relationship set : {(e 1 , ..., en )|e 1 ∈ E 1 , ..., en ∈ En } ✥ Each n-tuple denotes a relationship involving n entities (e 1 , ..., en ) where ei is in the entity set Ei ✥ A relationship can also include its own attributes (called descriptive attributes ✥ A relationship must be uniquely identified by its participating entities

2– 10 Introduction to Database Design ( 1. 1. 1 ) CSC 370 [email protected]

Example of a Ternary Relationship

name Since (^) dname ssn (^) lot did (^) budget Employees WorksIn2 (^) Departments address capacity

Role Indicators

name ssn (^) lot Employees supervisor (^) subordinate ReportsTo

Key Constraint on Manages

name Since (^) dname ssn (^) lot did (^) budget Employees (^) Manages Departments

Key Constraint on a Ternary Rel.

name Since (^) dname ssn (^) lot did budget Employees (^) WorksIn3 Departments address capacity

Total participation

name Since (^) dname ssn (^) lot did budget Employees (^) Manages Departments WorksIn Since

Weak Entities

✥ Sometimes the attributes associated with an entity set do not include a key ✥ A weak entity can be identified uniquely only by considering some of its attributes in conjunction with the primary key of another entity (called identifying owner entity) ✥ The following restrictions must hold: ✦ The owner entity set is a one-to-many to the weak entity ( identifying relationship set ) ✦ The weak entity set should have total participation in the identifying relationship set. ✥ Represented by drawing the relation and the weak entity in thick lines

Class Hierarchies

✥ Sometimes we need to define entities as “derivations” of others ( ISA ) ✥ That is, the attributes of an entity are those of another entity (its parent) plus other ones ✥ A class hierarchy can be seen in two different ways: ✦ Specialization: identify subsets of an entity that share some distinguishing characteristics ✦ Generalization: An entity is created that includes several characteristics common to different entity sets.

A Class Hierarchy

2– 20 Introduction to Database Design ( 1. 1. 1 ) CSC 370 [email protected] name ssn lot Employees hourlyWages hoursWorked (^) ISA contractId HourlyEmps ContractEmps