Академический Документы
Профессиональный Документы
Культура Документы
Enterprise Architect
Delivery Guide
Course Number: 2090A
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other
countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Contents
Introduction
Course Materials ......................................................................................................2
Prerequisites.............................................................................................................4
Course Outline .........................................................................................................5
Setup ........................................................................................................................7
Initial Logon Procedure ...........................................................................................9
Setting Screen Resolution ......................................................................................11
Microsoft Official Curriculum ...............................................................................12
Microsoft Certified Professional Program .............................................................13
Facilities.................................................................................................................16
Module 1: Introduction to Modeling Business Requirements
Module Overview ....................................................................................................1
Lesson: Overview of Database Modeling Process...................................................2
Lesson: Data Modeling Concepts ..........................................................................17
Lab A: Examining External Information ...............................................................33
Module 2: Analyzing External Information and Creating a Conceptual
ModelCSDP Step 1
Module Overview ....................................................................................................1
Lesson: Verbalizing Data Use Cases .......................................................................2
Lesson: Formalizing Fact Types ............................................................................23
Module Review......................................................................................................36
Lab A: Analyzing External Information and Creating a Conceptual Model
CSDP Step 1 ..........................................................................................................38
Module 3: Drawing a Conceptual Model and Entering Sample Data
CSDP Step 2
Module Overview ....................................................................................................1
Lesson: Drawing Fact Types ...................................................................................2
Lesson: Applying a Population Check...................................................................11
Lesson: Applying CSDP Step 2 .............................................................................17
Module Review......................................................................................................25
Lab A: Drawing Fact Types and Applying Population Checks .............................26
Lab A Discussion: Drawing Fact Types and Applying Population Checks...........32
Module 4: Trimming the Conceptual SchemaCSDP Step 3
Module Overview ....................................................................................................1
Lesson: Implementing Primitive Entity Types ........................................................2
Lesson: Implementing Derived Fact Types ...........................................................14
Lesson: Applying CSDP Step 3 .............................................................................22
Module Review......................................................................................................31
Lab A: Implementing Primitive Entity Types and Derived Fact TypesCSDP
Step 3 .....................................................................................................................32
iv Modeling Business Requirements to Create a Database Using Microsoft Visual Studio .NET Enterprise Architect
Student prerequisites This course requires that students meet the following prerequisites:
! Be familiar with databases and their uses.
! Have the ability to:
Describe what databases are and how they are used.
Understand basic programming concepts.
Understand the following relational database terms:
Tables
Columns
Data integrity
Data types
! Have the necessary skills to log on to and navigate in a Microsoft
Windows environment.
Course objectives After completing this course, students will be able to:
! Analyze business requirements.
! Create a conceptual database model by using ORM.
! Create a relational logical model.
! Validate the model against the external information.
! Transfer the model into a Microsoft SQL Server 2000 database.
viii Modeling Business Requirements to Create a Database Using Microsoft Visual Studio .NET Enterprise Architect
Course Timing
The following schedule is an estimate of the course timing. Your timing may
vary.
Day 1
Start End Module
9:00 9:30 Introduction
9:30 10:15 Module 1: Introduction to Modeling Business Requirements
10:15 11:00 Break
10:15 11:00 Lab A: Examining External Information
11:00 12:00 Module 2: Analyzing External Information and Creating a
Conceptual ModelCSDP Step 1
12:00 1:00 Lunch
1:00 1:30 Lab A: Analyzing External Information and Creating a
Conceptual ModelCSDP Step 1
1:30 2:30 Module 3: Drawing a Conceptual Model and Entering Sample
DataCSDP Step 2
2:30 3:00 Lab A: Drawing Fact Types and Applying Population Checks
3:00 3:15 Break
3:15 4:15 Module 4: Trimming the Conceptual SchemaCSDP Step 3
4:15 4:45 Lab A: Implementing Primitive Entity Types and Derived Fact
TypesCSDP Step 3
Modeling Business Requirements to Create a Database Using Microsoft Visual Studio .NET Enterprise Architect ix
Day 2
Start End Module
9:00 9:15 Day 1 review
9:15 10:15 Module 5: Adding Uniqueness Constraints and Checking Arity of
Fact TypesCSDP Step 4
10:15 10:30 Break
10:30 11:00 Lab A: Adding Uniqueness Constraints and Checking Arity of
Fact Types
11:00 12:00 Module 6: Adding Mandatory Role Constraints and Checking for
Logical DerivationsCSDP Step 5
12:00 1:00 Lunch
1:00 1:45 Lab A: Adding Mandatory Role Constraints, and Checking for
Logical Derivations
1:45 2:45 Module 7: Adding Value and Set Constraints, and Creating Entity
SubtypesCSDP Step 6
2:45 3:00 Break
3:00 3:30 Lab A: Adding Value Constraints, Set Constraints, and Entity
Subtypes
3:30 4:30 Module 8: Adding Frequency and Ring ConstraintsCSDP Step
7
4:30 5:00 Lab A: Implementing Frequency and Ring Constraints
Day 3
Start End Module
9:00 9:15 Day 2 review
9:15 10:00 Module 9: Generating a Relational Logical Model
10:00 10:30 Lab A: Generating a Relational Logical Model
10:30 11:00 Break
11:00 12:00 Module 10: Completing the Baseline Model
12:00 1:00 Lunch
1:00 1:30 Lab A: Completing the Baseline Model
1:30 2:45 Module 11: Generating and Reverse Engineering Physical
Schema
2:45 3:00 Break
3:00 3:30 Lab A: Forward and Reverse Engineering Physical Schema
x Modeling Business Requirements to Create a Database Using Microsoft Visual Studio .NET Enterprise Architect
Document Conventions
The following conventions are used in course materials to distinguish elements
of the text.
Convention Use
Contents
Introduction 1
Course Materials 2
Prerequisites 4
Course Outline 5
Setup 7
Initial Logon Procedure 9
Setting Screen Resolution 11
Microsoft Official Curriculum 12
Microsoft Certified Professional Program 13
Facilities 16
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Introduction iii
Instructor Notes
Presentation: The Introduction module provides students with an overview of the course
30 minutes content, materials, and logistics for Course 2090, Modeling Business
Requirements to Create a Database Using Microsoft Visual Studio .NET
Enterprise Architect.
Required materials To teach this course, you need the following materials:
! Delivery Guide
! Trainer Materials compact disc
Microsoft Certified Inform students about the Microsoft Certified Professional (MCP) program, any
Professional program certification exams that are related to this course, and the various certification
options.
Facilities Explain the class hours, extended building hours for labs, parking, restroom
location, meals, phones, message posting, and where smoking is or is not
allowed.
Let students know if your facility has Internet access that is available for them
to use during class breaks.
Also, make sure that the students are aware of the recycling program if one is
available.
Introduction 1
Introduction
! Name
! Company affiliation
! Title/function
! Job responsibility
! Database experience
! SQL Server experience
! Visio experience
! Infomodeler experience
! Expectations for the course
Course Materials
! Name card
! Student workbook
! Student Materials compact disc
! Course evaluation
! Additional resources
Note To open the Web page, insert the Student Materials compact disc into
the CD-ROM drive, and then in the root directory of the compact disc,
double-click Autorun.exe or Default.htm.
Prerequisites
Course Outline
! Module 1: Introduction to Modeling Business Requirements
! Module 2: Analyzing External Information and Creating a
Conceptual ModelCSDP Step 1
! Module 3: Drawing a Conceptual Model and Entering Sample
DataCSDP Step 2
! Module 4: Trimming the Conceptual SchemaCSDP Step 3
! Module 5: Adding Uniqueness Constraints and Checking Arity of
Fact TypesCSDP Step 4
! Module 6: Adding Mandatory Role Constraints and Checking for
Logical DerivationsCSDP Step 5
Setup
! Course files
" Lab files are located in the folder C:\Moc\2090\Labfiles\
on the student computers
" Practice files are located in the folder
C:\Moc\2090\Practices\ on the student computers
! Classroom setup
" Classroom is configured in the single domain/workgroup
model
Course Files Files associated with the course labs and practices are available to you. The lab
files are located in the folder C:\Moc\2090\Labfiles\ on the student computers.
The practice files are located in the folder C:\Moc\2090\Practices\ on the
student computers. Both of these folders have subfolders with answers.
Classroom Setup The classroom is configured in the single domain/workgroup model, as shown
in the following graphic.
8 Introduction
To create the password that you will use in this course, you must log on either
as Studentxx, where xx is your student number, or as Student, depending on
the classroom setup.
10 Introduction
The Logon Message dialog box appears, stating that your password must be
changed at initial logon.
! Requirements
! Tasks
http://www.microsoft.com/traincert/
Other related courses may become available in the future, so for up-to-date
information about recommended courses, visit the Training and Certification
Web site.
Microsoft Training and For more information, visit the Microsoft Training and Certification Web site at
Certification information http://www.microsoft.com/traincert/.
Introduction 13
Exam Core
Core exam
examforforthe
the Elective
Electiveexam
exam for
forthe
the
Examnumber
numberand
andtitle
title following
following track
track following
followingtrack
track
70-100:
70-100:Analyzing
AnalyzingRequirements
Requirements
and
andDefining
DefiningSolution
Solution MCSD
MCSD Not
Not Applicable
Applicable
Architectures
Architectures
http://www.microsoft.com/traincert/
! MCSD
The Microsoft Certified Solution Developer (MCSD) credential is the
premier certification for professionals who design and develop leading-edge
business solutions with Microsoft development tools, technologies,
platforms, and the Microsoft Windows DNA architecture. The types of
applications MCSDs can develop include desktop applications and multi-
user, Web-based, N-tier, and transaction-based applications. The credential
covers job tasks ranging from analyzing business requirements to
maintaining solutions.
! MCDBA on Microsoft SQL Server 2000
The Microsoft Certified Database Administrator (MCDBA) credential is the
premier certification for professionals who implement and administer
Microsoft SQL Server databases. The certification is appropriate for
individuals who derive physical database designs, develop logical data
models, create physical databases, create data services by using Transact-
SQL, manage and maintain databases, configure and manage security,
monitor and optimize databases, and install and configure SQL Server.
! MCP
The Microsoft Certified Professional (MCP) credential is for individuals
who have the skills to successfully implement a Microsoft product or
technology as part of a business solution in an organization. Hands-on
experience with the product is necessary to successfully achieve
certification.
! MCT
Microsoft Certified Trainers (MCTs) demonstrate the instructional and
technical skills that qualify them to deliver Microsoft Official Curriculum
through Microsoft Certified Technical Education Centers (Microsoft
CTECs).
Certification The certification requirements differ for each certification category and are
requirements specific to the products and job functions addressed by the certification. To
become a Microsoft Certified Professional, you must pass rigorous certification
exams that provide a valid and reliable measure of technical proficiency and
expertise.
For More Information See the Microsoft Training and Certification Web site at
http://www.microsoft.com/traincert/.
You can also send e-mail to mcphelp@microsoft.com if you have specific
certification questions.
Introduction 15
Acquiring the skills MOC and MSDN Training Curriculum can help you develop the skills that you
tested by an MCP exam need to do your job. They also complement the experience that you gain while
working with Microsoft products and technologies. However, no one-to-one
correlation exists between MOC and MSDN Training courses and MCP exams.
Microsoft does not expect or intend for the courses to be the sole preparation
method for passing MCP exams. Practical product knowledge and experience is
also necessary to pass the MCP exams.
To help prepare for the MCP exams, use the preparation guides that are
available for each exam. Each Exam Preparation Guide contains exam-specific
information, such as a list of the topics on which you will be tested. These
guides are available on the Microsoft Training and Certification Web site at
http://www.microsoft.com/traincert/.
16 Introduction
Facilities
! Class hours
! Building hours
! Parking
! Restrooms
! Meals
! Phones
! Messages
! Smoking
! Recycling
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 1: Introduction to Modeling Business Requirements iii
Instructor Notes
Presentation: This module is designed to provide students with a basic understanding of the
45 minutes overall database design procedure when using the Object Role Modeling
(ORM) methodology. Students should already be familiar with Entity
Lab: Relationship (ER) diagramming, so this module helps them through the difficult
45 minutes transition of modeling with ORM as opposed to ER.
Required materials To teach this module, you need the following materials:
! PowerPoint file 2090A_01.ppt
Lesson: Overview of This page gives an overview of the first lesson and introduces the topics
Database Modeling included. Emphasize that a model is a representation of a physical database, not
Process the database itself. The Universe of Discourse (UoD) is defined here, a term
that is used throughout the course. The UoD is a concept that students must
fully understand, or they will have significant difficulty in understanding future
topics.
Practice: Examining a Although students are not expected to be knowledgeable about ORM, this
Scheduling Modeling practice has them start thinking as they would if they were modeling in ORM in
Theme any work environment. Encourage them to go through the exercise without
asking for assistance. The goal is to have them come up with as many diverse
answers as possible. Suggested answers are provided at the end of the practice.
Data Modeling This page provides students with a very brief introduction and comparison of
Methodologies the three predominant database modeling methodologies. Students are expected
to be familiar with ER modeling and may have some basic understanding of
UML. You should emphasize that although ER and UML may be familiar,
ORM is the methodology of choice for modeling business requirements that
will ultimately become a Microsoft SQL Server 2000 database.
Practice: Working with This practice begins with an instructor-led demonstration of the Microsoft Visio
Visio Enterprise Enterprise Architect edition modeling tool that will be used in the course.
Architect Edition Students have a chance to see how basic relationships are represented and to
examine the user interface.
The Baseline Database This page shows students the four steps in the baseline database design
Design Process processExternal, Conceptual, Logical, and Physical. Emphasize the concept
of data collection and modeling, rather than immediately working on
implementation. Note that database performance, manageability, and
implementation details are covered in other courses.
Database Design Roles This page introduces the main roles in database modeling and design and
demonstrates how each relates to the steps in the database design process. You
may want to return to the previous slide to emphasize the linear nature of the
process.
Who Are Domain This page introduces the concept of domain experts, the group of people who
Experts? provide business requirements to the modeler. (Note that some students may
refer to these as subject matter experts.)
Business Context as a This page introduces the concept of how the business area being modeled is
Foundation part of the larger context of business recordkeeping. Emphasize that students
are modeling business requirements, as opposed to a database.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. If possible, limit discussion to modeling of business requirements
and try to resist the temptation to talk about implementation or compare
familiar methods of modeling with ORM.
Most of the information presented in this lesson is factual, so it is difficult to
fully assess what students have learned. After answering the questions, allow
students to discuss openly any of the topics covered.
vi Module 1: Introduction to Modeling Business Requirements
Note Do not present the UoD simply as the scope of the data model. It is
important that students understand that it also implies an ongoing dialog with
domain experts.
What Are Data Use This page explains the concept of data use cases and their relationship to the
Cases? UoD. Remind students that a data use case is an entire document, not a row in a
table or a given data value.
Instances, Populations, This page presents basic definitions for data modeling terminology and
Sets, and Collections introduces a series of slides on set theory. Note that you should reference these
slides when teaching later modules if necessary, to help students understand
how these key terms relate to data modeling.
Data Relationships This slide explains the concepts of cardinality and how one group of data
instances is related to another.
Set Existence This page reviews basic set theory; this content will be referenced many times
in future modules. You might suggest that students create a shortcut or print a
version for desktop use, if possible.
Set Forming Operations This page reviews basic set forming operations and the concept of forming a
new population from one or more sets.
What Are Functional This page introduces the concept of functional dependencies, where one
Dependencies? attribute in a relationship determines another. Solicit other examples from
students to ensure that they grasp this key concept.
Practice: Examining a This page allows students to repeat the practice from the first lesson, but this
Scheduling Modeling time they are armed with the knowledge of what they are looking for,
Theme specifically. As in the first iteration, allow students to work alone and then open
the class up for discussion so that they can share their discoveries.
Module 1: Introduction to Modeling Business Requirements vii
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions.
Most of the information presented in this lesson is factual, so it is difficult to
fully assess what students have learned. After answering the questions, allow
students to discuss openly any of the topics covered.
Module Review
Most of the information presented in this module is factual, so it is difficult to
fully assess what students have learned. After answering the questions, allow
students to openly discuss any of the topics covered. Use the lab as another
assessment and discuss answers aloud. Again, point out that there are no
specific right or wrong answers. Many problems can be solved in several
different ways.
Lab Setup
No lab setup requirements affect replication or customization. Slides for this lab
are available at the end of the module slide deck.
Lab Results
No configuration changes on student computers affect replication or
customization.
Module 1: Introduction to Modeling Business Requirements 1
Module Overview
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Manager Doctors Appt
1:1 All-han
10 00 Team Quaterl
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
1 00
Data Data
Modeling Modeling
2 00 Project Project
3 00
4 00
5 00
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-ha
10 00 Quart
Team
meeting Meeti
11 00
Off sit
pm Brownbag Traini
12 lunch: ORM Class
1 00
Data Data
00 Modeling Modeling
2 Project Project
3 00
4 00
5 00
Figure 1.1
4 Module 1: Introduction to Modeling Business Requirements
Appointment
Appointment time
time Location
Location
ID
ID Meeting
Meeting subject
subject Duration
Duration Recurring
Recurring
Weekday
Weekday Hour
Hour Building
Building Room
Room
11 Mon
Mon 10:30
10:30 Team
Team Meeting
Meeting 27
27 Conf
Conf AA 1.0
1.0 Yes
Yes
22 Tue
Tue 9:30
9:30 Manager
Manager 1:11:1 27
27 246
246 1.0
1.0 Yes
Yes
33 Tue
Tue 12:00
12:00 Brownbag
Brownbag Lunch:
Lunch: ORM
ORM 117
117 101
101 1.0
1.0 No
No
44 Tue
Tue 1:30
1:30 Data
Data Modeling
Modeling Project
Project 62
62 151
151 2.5
2.5 Yes
Yes
55 Wed
Wed 1:30
1:30 Data
Data Modeling
Modeling Project
Project 62
62 151
151 2.5
2.5 Yes
Yes
66 Thu
Thu 10:00
10:00 All-hands
All-hands Quarterly Meeting
Quarterly Meeting 117
117 101
101 1.5
1.5 No
No
77 Thu
Thu 11:00
11:00 Offsite
Offsite Training
Training Class
Class NA
NA NA
NA 5.0
5.0 No
No
88 Fri
Fri 9:00
9:00 Out
Out of
of Office:
Office: Doctor
Doctor Apt
Apt NA
NA NA
NA 2.5
2.5 No
No
Figure 1.2
Practice Carefully examine the information and perform the following tasks.
____________________________________________________________
2. Describe any further information that you would need to fully model the
scenario.
What does reoccurring mean? The calendar is for one week; what
about other weeks? What do different colors mean that are on the left
border of appointments? Who organizes meetings? Who is invited to
meetings?
____________________________________________________________
____________________________________________________________
3. Describe the sources that you would use to gather the needed information.
Check with the owner of the calendar, the organizers of meetings,
invitees to meetings, and the resources mentioned in the meetings.
____________________________________________________________
____________________________________________________________
____________________________________________________________
2. Consider the things of interest that you noted in the last question. Which
ones of them describe others?
Subjects describe what a meeting is about.
Buildings and rooms describe a location.
____________________________________________________________
____________________________________________________________
____________________________________________________________
Entity Relationship
diagrams Parent Child
Figure 1.3
Figure 1.4
Figure 1.5
Figure 1.6
Module 1: Introduction to Modeling Business Requirements 7
Room
PK RoomNumber
Subject
PK SubjectName
has
RoomTimeSlot
FK2,U1 SubjectName
Figure 1.7
Time
dayHour
roomNumber subjectName
Usage
Figure 1.8
8 Module 1: Introduction to Modeling Business Requirements
Object Role Modeling Object Role Modeling (ORM) is the only fact-oriented method with significant
support in the industry. ORM began in the early 1970s as a semantic modeling
approach that views the world simply in terms of objects playing roles (parts in
relationships). ORM is a rich modeling methodology that allows for the
modeling of complex fact-driven, data-related business requirements.
For example, the diagram in Figure 1.9 also portrays the relationships between
rooms, subjects, and time slots. In addition, it models constraints that only
allow unique room and time combinations, and unique combinations of time
and subjects.
Time
(Slot)
Room Subject
(Number) (Name)
...at...is used for...
Figure 1.9
Module 1: Introduction to Modeling Business Requirements 9
! Purpose
! Scenario
! Practice
Practice Carefully examine the information and perform the following tasks in Visio.
! Examine an ER model
1. In the Visio window, on the File menu, click Open. In the File name box,
type C:\MOC\2090\Practices\Mod01\ExamineER.vsd and then click
Open.
2. On the Database menu, point to View, and then click Code.
3. On the Database menu, point to View, and then click Tables and Views.
4. In the Tables and Views window, double click Meeting.
Notice that on the drawing surface, the shape labeled Meeting is now
selected.
5. On the Database menu, point to Options, and then click Document.
6. In the Database Document Options dialog box, on the Relationship tab,
select Crows feet and then click OK.
Modeling
Modelingbusiness
businessrequirements
requirements Modeling
Modelingdatabases
databases
External
External Conceptual
Conceptual Logical
Logical Physical
Physical
Figure 1.10
Modeling databases After you have captured all business requirements in a conceptual model, you
generate a relational database model. This stage also has two phases:
! Logical modeling phase
A relational logical model is the representation of business requirements in
terms of tables, columns, and relationshipsa direct translation from the
conceptual model, without adding any physical characteristics.
! Physical modeling phase
The baseline physical database schema is a refinement of the logical model
that specifies SQL Server physical characteristics such as names, physical
data types, and procedural Transact-SQL code. A baseline physical database
schema is not optimized for performance or manageability.
12 Module 1: Introduction to Modeling Business Requirements
Figure 1.11
Modeling methodology You will use ORM to model business requirements during the Conceptual
phase.
You will use a relational form of ER modeling to generate a logical database
model.
You will use Transact-SQL DDL to represent a physical database schema for
SQL Server.
14 Module 1: Introduction to Modeling Business Requirements
! Definition
Domain experts are the people who provide business
requirements to the modeler
! Examples
" Subject matter experts
" Knowledge workers
" Business analysts
" System architects
" Developers
Record Keeping
Mon Tue Wed Thu Fri
8 am
Appointment
Appointmenttime
Appointment
Appointment time
time
time Location
Location
Location
Location
ID
ID
ID
ID Meeting
Meeting
Meetingsubject
Meeting subject
subject
subject Duration
Duration Recurring
Duration
Duration Recurring
Recurring
Recurring
Weekday
Weekday Hour
Weekday
Weekday Hour
Hour
Hour Building
Building
Building
Building Room
Room
Room
Room
1111 Mon
Mon
Mon
Mon 10:30
10:30
10:30
10:30 Team
TeamMeeting
Team
Team Meeting
Meeting
Meeting 27
27
27
27 Conf
ConfAAA
Conf
Conf 1.0
1.0
1.0
1.0 Yes
Yes
Yes
Yes
2222 Tue
Tue
Tue
Tue 9:30
9:30
9:30
9:30 Manager
Manager1:1
Manager
Manager 1:1
1:1
1:1 27
27
27
27 246
246
246
246 1.0
1.0
1.0
1.0 Yes
Yes
Yes
Yes
3333 Tue
Tue
Tue
Tue 12:00
12:00
12:00
12:00 Brownbag
BrownbagLunch:
Brownbag
Brownbag Lunch:ORM
Lunch:
Lunch: ORM
ORM
ORM 117
117
117
117 101
101
101
101 1.0
1.0
1.0
1.0 No
No
No
No
4444 Tue
Tue
Tue
Tue 1:30
1:30
1:30
1:30 Data
DataModeling
Data ModelingProject
Modeling
Modeling Project
Project
Project 62
62
62
62 151
151
151
151 2.5
2.5
2.5
2.5 Yes
Yes
Yes
Yes
5555 Wed
Wed
Wed
Wed 1:30
1:30
1:30
1:30 Data
DataModeling
Data ModelingProject
Modeling
Modeling Project
Project
Project 62
62
62
62 151
151
151
151 2.5
2.5
2.5
2.5 Yes
Yes
Yes
Yes
6666 Thu
Thu
Thu
Thu 10:00
10:00
10:00
10:00 All-hands
All-handsQuarterly
All-hands
All-hands QuarterlyMeeting
Quarterly
Quarterly Meeting
Meeting
Meeting 117
117
117
117 101
101
101
101 1.5
1.5
1.5
1.5 No
No
No
No
7777 Thu
Thu
Thu
Thu 11:00
11:00
11:00
11:00 Offsite
OffsiteTraining
Offsite
Offsite TrainingClass
Training
Training Class
Class
Class NA
NA
NA
NA NA
NA
NA
NA 5.0
5.0
5.0
5.0 No
No
No
No
8888 Fri
Fri
Fri
Fri 9:00
9:00
9:00
9:00 Out
Outof
Out
Out ofOffice:
of
of Office:Doctor
Office:
Office: DoctorApt
Doctor
Doctor Apt
Apt
Apt NA
NA
NA
NA NA
NA
NA
NA 2.5
2.5
2.5
2.5 No
No
No
No
SQL
Figure 1.12
Record keeping Within the business area, record keeping is really about recording data.
Database solutions automate record keeping. For a given data model, the set of
sample documents that the domain experts provide defines the scope of the data
that is modeled and, ultimately, stored in the database.
16 Module 1: Introduction to Modeling Business Requirements
Lesson Review
Objectives
Objectives
Summarize
Summarizethe
theprocess
process of
ofmodeling
modelingaabaseline
baseline
database
databasemodel
model
Identify
Identifythe
the three
three major
majordatabase
databasemodeling
modeling
methodologies
methodologies
Describe
Describethe
the process
processof
of modeling
modeling business
business
requirements
requirements
Describe
Describethe
the roles
rolesof
of those
thoseinvolved
involvedin
indata
data
modeling
modeling
! Definition
The Universe of Discourse is all aspects of the world that
you want to talk about that will be automated
! Characteristics
" Is determined by domain experts
" Represents the scope of data model
" Implies either an open or a closed model
Tip When communicating with domain experts, make sure that all parties
agree whether the model is open or closed.
20 Module 1: Introduction to Modeling Business Requirements
! Definition
A data use case is a snapshot of data values and their
relationships in the UoD as contained in some existing
or proposed business document
! Characteristics
" Provided by domain experts
" Represent business facts and requirements
Note An entire document is considered a data use case, not just a given data
value. It shows a case of a group of data values being used together. It provides
the context of meaning for the data values.
! Instance Population
! Population A C E
! Set B D
Figure 1.13
! Member
! Collection Collection
C E
A D
A D
Figure 1.14
Data Relationships
1:1
! Cardinality
A B
" One-to-one (1:1)
Figure 1.15
" One-to-many (1:n)
1:n
" Many-to-many (n:m) B
! Mandatory vs. optional A B
cardinality
B
Figure 1.16
n:m
A B
B
A B
Figure 1.17
Mandatory vs. optional With respect to cardinality, mandatory cardinality implies that at least one
cardinality instance is involved on a given side of a relationship. Optional cardinality
implies that an instance could exist in one population that does not have a
correlated instance in another population. Optional cardinality is expressed by
introducing the word zero in the cardinality phrase, such as one to zero or
one, zero or one to many.
For example, the relationships depicted in Figures 1.15, 1.16, and 1.17 all
portray mandatory cardinality. If you removed all of the B instances from any
of the figures, that figure would then depict a form of optional cardinality.
Module 1: Introduction to Modeling Business Requirements 23
Set Existence
A B
A B
Identity Subset
A B A B
{1,2} {3,4}
{apple, orange} {pear, banana}
Overlap Two sets exhibit overlap if and only if they share at least one member in
common, and they both have at least one other member unique to the set.
Figure 1.19 indicates that set A shares a member with set B, that both sets A
and B each contain at least one other member, and that those other members
each are unique to set A and B, respectively.
Table 1.2
Set A Set B
{1,2,3} {2,3,4}
{apple, orange, pear} {orange, pear, banana}
24 Module 1: Introduction to Modeling Business Requirements
Identity Two sets are identical if and only if they each contain all of the same members.
Figure 1.20 indicates that set A and set B are identical in all respects.
Table 1.3
Set A Set B
{1,2,3,4} {1,2,3,4}
{apple, orange, pear, banana} {apple, orange, pear, banana}
Subset A set is a subset of another set if and only if all of the first sets members exist
in the second set. Figure 1.21 indicates that all of set As members are also
contained in set B.
Table 1.4
Set A Set B
{1,2} {1,2,3,4}
{apple, orange} {apple, orange, pear, banana}
Module 1: Introduction to Modeling Business Requirements 25
Union of sets X Y
XUY
Figure 1.22
Intersection of sets X Y
U
X Y
Figure 1.23
Difference of sets X Y
X-Y
Figure 1.24
Intersection of sets The members that two or more sets have in common are known as an
intersection of sets. Figure 1.23 illustrates that a new set is formed when all
members that are not held in common with set X and set Y are removed, as the
shaded area indicates.
Table 1.6
Set X Set Y Intersection of sets
Difference of sets If the common members of one set and another are removed from the first set,
the remaining members of the first set are known as the difference of those sets.
Figure 1.24 illustrates that a new set is formed when all members of set Y,
including those that also exist in set X, are removed from set X, as the shaded
area indicates.
Table 1.7
Set X Set Y Difference of set Y from set X
! Definition
A population is functionally dependent on another if, for
every instance in the latter population, there is exactly
one instance in the former
! Characteristics
" One population is determined by another
" Instances in the parent population are unique
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Manager Doctors Appt
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
1 00
Data Data
00 Modeling Modeling
2 Project Project
3 00
4 00
5 00
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-ha
10 00 Quart
Team
meeting Meeti
11 00
Off sit
Brownbag Traini
12 pm lunch: ORM Class
1 00
Data Data
00 Modeling Modeling
2 Project Project
3 00
4 00
5 00
Figure 1.1
Module 1: Introduction to Modeling Business Requirements 29
Appointment
Appointment time
time Location
Location
ID
ID Meeting
Meeting subject
subject Duration
Duration Recurring
Recurring
Weekday
Weekday Hour
Hour Building
Building Room
Room
11 Mon
Mon 10:30
10:30 Team
Team Meeting
Meeting 27
27 Conf
Conf AA 1.0
1.0 Yes
Yes
22 Tue
Tue 9:30
9:30 Manager
Manager 1:11:1 27
27 246
246 1.0
1.0 Yes
Yes
33 Tue
Tue 12:00
12:00 Brownbag
Brownbag Lunch:
Lunch: ORM
ORM 117
117 101
101 1.0
1.0 No
No
44 Tue
Tue 1:30
1:30 Data
Data Modeling
Modeling Project
Project 62
62 151
151 2.5
2.5 Yes
Yes
55 Wed
Wed 1:30
1:30 Data
Data Modeling
Modeling Project
Project 62
62 151
151 2.5
2.5 Yes
Yes
66 Thu
Thu 10:00
10:00 All-hands
All-hands Quarterly Meeting
Quarterly Meeting 117
117 101
101 1.5
1.5 No
No
77 Thu
Thu 11:00
11:00 Offsite
Offsite Training
Training Class
Class NA
NA NA
NA 5.0
5.0 No
No
88 Fri
Fri 9:00
9:00 Out
Out of
of Office:
Office: Doctor
Doctor Apt
Apt NA
NA NA
NA 2.5
2.5 No
No
Figure 1.2
Practice Carefully examine the information in the scenario and perform the following
tasks.
____________________________________________________________
2. Describe any further information that you would need to fully model the
scenario.
What does reoccurring mean? The calendar is for one week; what
about other weeks? What do different colors mean that are on the left
border of appointments? Who organizes meetings? Who is invited to
meetings?
____________________________________________________________
____________________________________________________________
3. Describe the sources that you would use to gather the needed information.
Check with the owner of the calendar, the organizers of meetings,
invitees to meetings, and the resources mentioned in the meetings.
____________________________________________________________
____________________________________________________________
____________________________________________________________
2. Consider the sets or populations that you noted in the last question. Which
of them describes another?
Subjects describe what a meeting is about.
Buildings and rooms describe a location.
____________________________________________________________
____________________________________________________________
____________________________________________________________
Lesson Review
Objectives
Objectives
Summarize
Summarizedata
datamodeling
modeling concepts
concepts
Describe
Describethe
the Universe
Universeof
of Discourse
Discourse
Distinguish
Distinguish between
betweendifferent
differentset
set characteristics
characteristics
Describe
Describefunctional
functionaldependencies
dependencies
The set of all vaccinated dogs and the set of Dalmatians, including those
that are vaccinated and those that are not.
The population of vaccinated dogs overlaps with the population of all
Dalmatians.
32 Module 1: Introduction to Modeling Business Requirements
Module Review
Scenario A separate database modeling scenario is presented in each lab exercise in the
form of samples of external information.
In each exercise, you will examine the samples of external information related
to the scenario and identify preliminary elements of a data model for future
consideration.
These exercises lay the foundation for future discussions, practices, and
exercises that use these same scenarios throughout this course.
Estimated time to You should complete each exercise in approximately 20 to 25 minutes.
complete this lab:
45 minutes
34 Module 1: Introduction to Modeling Business Requirements
Exercise 1
Examining an Airline Flights Theme
In this exercise, you will examine samples of external information related to a
scenario, and identify preliminary elements of a database model for future
consideration.
Scenario You are assigned the task of modeling the external information contained in
Figures 1A.1 and 1A.2. You have not been told what the information in the
figure and table represents, or what the database model will represent.
London
UK11 (LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES23 (MAD) (FCO)
Atlanta US56
VE56
(ATL)
VE59
US68 Dakar
VE56
(DKR)
Caracas
(CCS)
Figure 1A.1
Figure 1A.1 contains sample data values that are correlated to the information
represented by Figure 1A.2.
UK11
UK11 London
London New
New York
York 33 55 14:25
14:25 On
On Time
Time
US72
US72 New
New York
York London
London 4E
4E 19
19 1:55
1:55 Delayed
Delayed
IT37
IT37 Rome
Rome New
New York
York Intl
Intl 12
12 11:12
11:12 Boarding
Boarding
ES23
ES23 Madrid
Madrid Atlanta
Atlanta 33 55 11:12
11:12 On
On Time
Time
US56
US56 Atlanta
Atlanta Rome
Rome TT 99 23:50
23:50 On
On Time
Time
VE59
VE59 Caracas
Caracas New
New York
York Intl
Intl 22 8:03
8:03 Cancelled
Cancelled
VE56
VE56 Caracas
Caracas Rome
Rome Intl
Intl 44 8:48
8:48 On
On Time
Time
US68
US68 Atlanta
Atlanta Caracas
Caracas TT 88 4:54
4:54 Boarding
Boarding
Figure 1A.2
Module 1: Introduction to Modeling Business Requirements 35
Tasks Carefully examine the information in the scenario and perform the following
tasks.
____________________________________________________________
2. Describe any further information that you would need to fully model the
scenario.
What do the three-letter codes below city names represent? What do
the lines between cities represent? What to the arrow tips on the lines
represent? Is there a relationship between flight numbers and the point
of origin of the flights, or with the direction of travel?
____________________________________________________________
____________________________________________________________
3. Describe the sources that you would use to gather the needed information.
Check with whoever provided the information, the airlines, and the
airports.
____________________________________________________________
____________________________________________________________
____________________________________________________________
2. Consider the sets or populations that you noted in the last question. Which
of them describe others?
Flight numbers identify flights.
Airport codes identify airports.
____________________________________________________________
____________________________________________________________
____________________________________________________________
Exercise 2
Examining an Academic Faculty Theme
In this exercise, you will examine samples of external information related to a
scenario, and identify preliminary elements of a database model for future
consideration.
Scenario You are assigned the task of modeling the external information contained in
Figures 1A.3 and 1A.4. You have not been told what the information in the
figure and table represents, or what the database model will represent.
Linda
LindaSwift
Swift
Dean
Dean
Tenured
Tenured
Gerri
GerriNorton
Norton John
JohnLane
Lane Amber
AmberBeckman
Beckman
Math
MathDept
DeptHead
Head Literature
LiteratureDept
DeptHead
Head History
HistoryDept
DeptHead
Head
Jun
Jun8,8,2003
2003 Tenured
Tenured Tenured
Tenured
James
JamesCalouri
Calouri Paula
PaulaAbels
Abels Troy
TroyFinch
Finch
Professor
Professor Professor
Professor Professor
Professor
Tenured
Tenured Tenured
Tenured Tenured
Tenured
Jeremy
JeremyAlexander
Alexander Vanessa
VanessaThompson
Thompson Ida
IdaCezar
Cezar
Senior
SeniorLecturer
Lecturer Lecturer
Lecturer Senior
SeniorLecturer
Lecturer
Aug
Aug15,
15,2004
2004 June
June8,8,2003
2003 Sep
Sep9,9,2004
2004
John
JohnLane
Lane
Lecturer
Lecturer
May
May25,
25,2003
2003
Figure 1A.3
Figure 1A.3 contains sample data values that are correlated to the information
represented by Figure 1A.4.
Employee Location
Location Office
Office phone
phone Home
Employee Home
Employee
Employee name
name Dept
Dept
number
number Blg
Blg Room
Room Ext
Ext Access
Access phone
phone
5922
5922 Abels,
Abels, P.
P. Literature
Literature 27
27 78
78 7705
7705 Full
Full NA
NA
7442
7442 Alexander,
Alexander, J. J. Math
Math 27
27 58
58 9497
9497 Local
Local NA
NA
5349
5349 Beckman,
Beckman, A. A. History
History 62
62 151
151 4562
4562 Full
Full 555-3351
555-3351
6961
6961 Calouri,
Calouri, J.J. Math
Math 62
62 39
39 9831
9831 Full
Full NA
NA
4218
4218 Cezar,
Cezar, I.I. History
History 27
27 282
282 4567
4567 Local
Local NA
NA
7947
7947 Finch,
Finch, T.
T. History
History 62
62 53
53 4319
4319 Full
Full NA
NA
5254
5254 Lane,
Lane, J.
J. Literature
Literature 27
27 246
246 2146
2146 Full
Full 555-1967
555-1967
1851
1851 Lane,
Lane, J.
J. Math
Math 62
62 149
149 3991
3991 Local
Local NA
NA
2849
2849 Norton,
Norton, G.G. Math
Math 62
62 151
151 8873
8873 Full
Full 555-6405
555-6405
2350
2350 Swift,
Swift, L.
L. Admin
Admin 27
27 150
150 5041
5041 Full
Full 555-6405
555-6405
1689
1689 Thompson,
Thompson, V. V. Literature
Literature 62
62 311
311 5403
5403 Local
Local NA
NA
Figure 1A.4
38 Module 1: Introduction to Modeling Business Requirements
Tasks Carefully examine the information in the scenario and perform the following
tasks.
____________________________________________________________
2. Describe any further information that you would need to fully model the
scenario.
What do the dates on the chart mean? Why do only some employees
have home telephones listed? Why do different employees have
different levels of office telephone access? Are job titles significant? Are
the two employees listed as John Lane the same person?
____________________________________________________________
____________________________________________________________
3. Describe the sources that you would use to gather the needed information.
Check with whoever provided the information, department heads, or
the university administration.
____________________________________________________________
____________________________________________________________
____________________________________________________________
2. Consider the sets or populations that you noted in the last question. Which
of them describe others?
Employee names, numbers, academic ranks, and tenure status describe
academic employees.
Offices are located in a building and rooms.
Telephone extensions and access levels describe office phones.
____________________________________________________________
____________________________________________________________
____________________________________________________________
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 iii
Instructor Notes
This module teaches students the Conceptual Schema Design Procedure
(CSDP) step 1. This step covers analyzing external information and entering
elementary facts into the Fact Editor, which creates the conceptual model.
Presentation: This module provides students with the necessary knowledge and skills to
60 minutes complete CSDP step 1.
Lab: After completing this module, students will be able to:
30 minutes
! Complete CSDP step 1.
Verbalize data use cases.
Formalize fact types.
Create a conceptual model.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_02.ppt
What Are Object Types? This topic page defines and provides the characteristics of object types. Note
that object means a single instance, while object type refers to all possible
instances.
What Are Predicates? This topic page defines and provides the characteristics of predicates.
What Are Fact Types? This topic page defines and provides the characteristics of fact types.
How to Verbalize Fact This page instructs students on the high-level steps of how to verbalize fact
Types types.
Practice: Verbalizing This page reinforces the elements of the previous page through practice of the
Fact TypesScheduling procedure by using the Scheduling Theme. (This should be an instructor-led
Theme group practice.)
Practice: Verbalizing This page reinforces the elements of the previous page through practice of the
Fact TypesAirline procedure by using the Airline Flights Theme.
Flights Theme
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering questions, allow students to openly discuss any
of the topics covered.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 v
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering questions, allow students to openly discuss any
of the topics covered.
Module Review
After answering the questions, allow students to openly discuss any of the
topics covered.
vi Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
Lab Setup
There are no lab setup requirements that affect replication or customization.
Lab Results
There are no configuration changes on student computers that affect replication
or customization.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 1
Module Overview
Important In reality, you would work with a single model throughout the
CSDP process. In this course, however, there is no single unifying model in the
lessons covering CSDP.
! Fact-Driven Design
! What Are Fact Instances?
! What Are Object Types?
! What Are Predicates?
! What Are Fact Types?
! Howe to Verbalize Fact Types
! Practice: Verbalizing Fact TypesScheduling Theme
! Practice: Verbalizing Fact TypesAirline Flights Theme
Fact-Driven Design
! Definition
A fact instance is an individual observation of the
relationship between two or more data values
! Characteristics
" Are examples of relationships between specific data
" Are related through an action statement
" May have constraints
the author Hemingway and the book A Farewell to Arms are both data
values, related by the action verb writes.
! May have constraints.
You can qualify the action statement so that it constrains the relationship
between objects in the fact instance.
For example, you can subtly modify the fact instance to read:
The Author known as Hemingway wrote only one Book known
by the Title A Farewell to Arms
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 5
! Definition
An object type represents the set of all possible instances
of a given object
! Characteristics
" Generic representations of populations
" Always named singularly
" Always title case
" Object kind
! Definition
A predicate is a verb phrase that the domain expert uses
to relate object types
! Characteristics
" Are sentence fragments with holes in them for object
type names
" Describe unqualified relationships
" Have reversible readings
Important Only the domain expert can provide the verb phrase that adequately
conveys the meaning of the relationship between object types in the UoD.
the phase only one constrains the fact instance. Without that constraint,
the predicate wrote represents an unqualified description of the
relationship between the author Hemingway and the book A Farewell to
Arms.
! Have reversible readings.
All predicates must convey the same information whether they are read
foreword or backward.
For example, the fact instance
The Author known as Hemingway wrote the Book known by the
Title A Farewell to Arms
! Definition
A fact type is the set of fact instances that share the same
object types and predicate relationships
! Characteristics
" Syntax: [Object type] predicate [Object type]
" Arity of a fact type
" Generic representation
" Reversible predicate reading
Examine
Examineexternal
externalinformation
information
Identify
Identifyfact
fact instances
instances
Identify
Identifyobject
objecttypes
types
Identify
Identifyunconstrained
unconstrainedpredicates
predicates
Express
Expressfact
fact types
typesin
in terms
termsof
ofobject
object types
types and
and
predicates
predicates
AA doctors
doctors
8 am appointment
appointmentisis
scheduled
scheduled for for Out of Office:
9 00 2.5
2.5 hours
hours at
at9:00
9:00 Doctors Appt
Manager
1:1 on
on Friday
Friday out
out of
of
All-ha
10 00
AA brownbag
the
theoffice
office
Quart
brownbagTeam
lunch meeting meeting Meeti
lunch
11 00 meeting
on
on ORM
ORM isis Off sit
scheduled
scheduled for
for11 Brownbag AA data
datamodeling
modeling Traini
12 pm noon
hour
hourat at noon lunch: ORM meeting isis Class
meeting
Tuesday
Tuesday in
inroom
room scheduled
scheduled for for
101
101of
1of00building
building Data Data 2.5
2.5 hours
hours at at
117
117
00 Modeling 1:30PM
Modeling1:30PMon on
2 Project Project
Tuesday
Tuesday in in room
room
151
151 of
ofbuilding
building
3 00 62
62
Figure 2.1
4 00
1 22 3 5 00
Appointment
Appointment time
time Location
Location
ID
ID Meeting
Meeting subject
subject Duration
Duration Recurring
Recurring
Weekday
Weekday Hour
Hour Building
Building Room
Room
11 Mon
Mon 10:30
10:30 Team
Team Meeting
Meeting 27
27 Conf
Conf AA 1.0
1.0 Yes
Yes
22 Tue
Tue 9:30
9:30 Manager
Manager 1:11:1 27
27 246
246 1.0
1.0 Yes
Yes
33 Tue
Tue 12:00
12:00 Brownbag
Brownbag Lunch:
Lunch: ORM
ORM 117
117 101
101 1.0
1.0 No
No
44 Tue
Tue 1:30
1:30 Data
Data Modeling
Modeling Project
Project 62
62 151
151 2.5
2.5 Yes
Yes
55 Wed
Wed 1:30
1:30 Data
Data Modeling
Modeling Project
Project 62
62 151
151 2.5
2.5 Yes
Yes
66 Thu
Thu 10:00
10:00 All-hands
All-hands Quarterly
Quarterly Meeting
Meeting 117
117 101
101 1.5
1.5 No
No
77 Thu
Thu 11:00
11:00 Offsite
Offsite Training
Training Class
Class NA
NA NA
NA 5.0
5.0 No
No
88 Fri
Fri 9:00
9:00 Out
Out of
of Office:
Office: Doctor
Doctor Apt
Apt NA
NA NA
NA 2.5
2.5 No
No
Figure 2.2
12 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
Practice Use the following procedure and tables to catalog fact types in the scenario.
____________________________________________________________
____________________________________________________________
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 13
____________________________________________________________
2. A single fact instance is listed below. List all other similar fact instances
presented by the information in Figure 2.1 and Figure 2.2 in plain language
sentences by using a similar verbal pattern.
Meeting 1 has Subject of Team Meeting.
Meeting 2 has Subject of Manager 1:1.
Meeting 3 has Subject of Brownbag Lunch: ORM.
Meeting 4 has Subject of Data Modeling Project.
Meeting 5 has Subject of Data Modeling Project.
Meeting 6 has Subject of All-hands Quarterly Meeting.
Meeting 7 has Subject of Offsite Training Class.
Meeting 8 has StartTime of Out of Office: Doctor's Appointment.
____________________________________________________________
____________________________________________________________
14 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
3. A single fact instance is listed below. List all other similar fact instances
presented by the information in Figure 2.1 and Figure 2.2 in plain language
sentences by using a similar verbal pattern.
Meeting 1 has Location in Building 27, Conference Room A.
Meeting 2 has Location in Building 27, Conference Room 246.
Meeting 3 has Location in Building 117, Conference Room 101.
Meeting 4 has Location in Building 62, Conference Room 151.
Meeting 5 has Location in Building 62, Conference Room 151.
Meeting 6 has Location in Building 117, Conference Room 101.
Meeting 7 has Location in Offsite.
Meeting 8 has Location in Doctor's Office.
____________________________________________________________
____________________________________________________________
4. A single fact instance is listed below. List all other similar fact instances
presented by the information in Figure 2.1 and Figure 2.2 in plain language
sentences by using a similar verbal pattern.
Meeting 1 reoccurs.
Meeting 2 reoccurs.
Meeting 4 reoccurs.
Meeting 5 reoccurs.
____________________________________________________________
____________________________________________________________
What are the high-level similarities and differences between the fact
instances?
Each fact instance similarly describes what, where, when information
about each meeting.
Not all meetings are recurring. Not all meetings take place on site.
____________________________________________________________
____________________________________________________________
____________________________________________________________
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 15
____________________________________________________________
2. What is the fact type phrase for the following fact instance?
Meeting 1 has Subject of Team Meeting.
Meeting 2 has Subject of Manager 1:1.
Meeting has Subject.
____________________________________________________________
____________________________________________________________
16 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
3. What is the fact type phrase for the following fact instance?
Meeting 1 has Location in Building 27, Conference Room A.
Meeting 2 has Location in Building 27, Conference Room 246.
Meeting has Location.
____________________________________________________________
____________________________________________________________
4. What is the fact type phrase for the following fact instance?
Meeting 1 is recurring.
Meeting 2 is recurring.
Meeting is recurring.
____________________________________________________________
____________________________________________________________
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 17
London
UK11
UK11 (LHR)
US72
New York IT37
Madrid Rome
(JFK)
ES23 (MAD) (FCO)
Atlanta US62
US62
US62
US56
VE56
VE56
(ATL)
VE59
US68 Dakar
VE56
VE56 (DKR)
Caracas Flight
FlightUK11
VE56
UK11
VE56 originates
originates inin
Flight
FlightUS62
US62 originates
originates ininAtlanta
Atlanta
(CCS) London
Caracas
London and
Caracas and
and terminates
and terminates
terminates
terminates ininNew
in
New
in
and
andterminates
terminates ininRome.
Rome.
Rome.
York.
Rome.
York.
Figure 2.3
1 22 3
UK11
UK11 London
London New
New York
York 33 55 14:25
14:25 On
On Time
Time
US72
US72 New
New York
York London
London 4E
4E 19
19 1:55
1:55 Delayed
Delayed
IT37
IT37 Rome
Rome New
New York
York Intl
Intl 12
12 11:12
11:12 Boarding
Boarding
ES23
ES23 Madrid
Madrid Atlanta
Atlanta 33 55 11:12
11:12 On
On Time
Time
US56
US56 Atlanta
Atlanta Rome
Rome TT 99 23:50
23:50 On
On Time
Time
VE59
VE59 Caracas
Caracas New
New York
York Intl
Intl 22 8:03
8:03 Cancelled
Cancelled
VE56
VE56 Caracas
Caracas Rome
Rome Intl
Intl 44 8:48
8:48 On
On Time
Time
US68
US68 Atlanta
Atlanta Caracas
Caracas TT 88 4:54
4:54 Boarding
Boarding
Figure 2.4
18 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
Practice Use the following procedure and tables to verbalize fact types in the scenario.
____________________________________________________________
____________________________________________________________
____________________________________________________________
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 19
____________________________________________________________
What are the high-level similarities and differences between the fact
instances?
Each fact instance similarly describes the cities where the flight
originates and its final destination.
____________________________________________________________
____________________________________________________________
20 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
2. Two fact instances are listed below. List all other similar fact instances
presented by the information in Figures 2.3 and Figure 2.4 in plain language
sentences by using a similar verbal pattern.
Flight UK11 has status of on time.
Flight IT37 has status of boarding.
Flight US72 has status of delayed.
Flight ES23 has status of on time.
Flight US56 has status of on time.
Flight VE59 has status of canceled.
Flight VE56 has status of on time.
Flight US68 has status of boarding.
____________________________________________________________
____________________________________________________________
What are the high-level similarities and differences between the fact
instances?
Each fact instance similarly describes current status of a flight; some
are canceled, some are delayed, some are boarding, and some are on
time.
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
22 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
Lesson Review
Objectives
Objectives
Verbalize
Verbalize fact
fact types
types
Describe
Describe and
and identify
identify fact
fact instances
instances
Describe
Describe and
and identify
identify object
object types
types
Describe
Describe and
and identify
identify predicates
predicates
3. Define predicates.
A predicate is a verb phrase that the domain expert uses to relate object
types.
! Communicating Intent
! Classifying Object Types
! Introduction to CSDP Step 1
! How to Enter Facts into the Conceptual Model
! Practice: Entering Fact TypesScheduling Theme
! Practice: Entering Fact TypesAirline Flights Theme
Communicating Intent
! Object kind
" Value type
" Entity type
" External
! Entity type identifier
" Reference mode
" Reference type
Entity type identifier You can set the following special characteristics in an ORM model to help you
identify instances of entity types:
! Reference mode
You can uniquely identify any given instance of an entity type by a special
value type known as its reference mode. Object types are commonly
referred to in fact instances by their reference mode.
For example, you can refer to an instance of a Person entity type by that
persons name.
! Reference type
The data values that reference modes hold are grouped into three categories:
identification, measurement, and formatting.
For example, you can use a persons employee number for identifying the
person. You can use the distance covered in a foot race to identify what type
of race it is, such as 100 meters, 10 kilometers, or 26 miles. You can use a
pattern of formatting to identify a date, such as YYYYMMDD.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 27
! CSDP step 1
Transform familiar information examples into elementary
facts, and apply quality checks
Important Because each step in the CSDP process builds on the previous steps,
it is important that you continually recheck your work. Mistakes made early in
the process will complicate the model in subsequent steps.
28 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
Focus of CSDP step 1 CSDP is the process by which you model databases using the ORM
methodology. It:
! Creates the conceptual model.
As soon as you enter the first component of external information into the
Fact Editor in Microsoft Visio Enterprise Architect edition, you have
created your conceptual model. The model exists, even though you do not
see the graphical representation at this time. (This is covered in CSDP
step 2.)
! Fact-driven design.
Remember that your data modeling methodology is based on a data-driven
design. ORM is structured to capture object types, the fact types that
represent relationships between them, and the constraints placed on the
populations of the fact types that restrict the allowable database states.
! Communicates intent.
The main purpose of CSDP step 1 is to communicate with the domain
expert and create a conceptual model that accurately reflects the domain
experts understanding of the UoD. If you enter object types and fact types
into the ORM model, you can use them to document the UoD as a series of
FORML expressions that both you and the domain expert can understand.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 29
Enter
Enter new
new object
object types
types
Set
Set the
the fact
fact arity
arity
Select
Select existing
existing object
object types
types
Enter
Enter text
text describing
describing relationships
relationships
Validate
Validate your
your intent
intent with
with aa FORML
FORML expression
expression
Tip You actually select an object type in the Fact Editor through a combo
box. If you type an object type name that is not in the combo box, then the
Fact Editor creates a new object type automatically. As a best practice, use
the drop-down menu to select object types.
30 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Class
Brownbag
12 pm Lunch: ORM
1 00
Data Data
Modeling Modeling
2 00 Project Project
3 00
4 00
5 00
Practice Use the following procedures to enter a single fact type into an ORM source
model, and then repeat for each fact type in the scenario.
____________________________________________________________
4. For each object type in the scenario fact type that does not exist in the
Object Types pane, press F2, type object type name, and then press ENTER.
! Repeat as necessary
Repeat the previous four procedures for each of the fact types in the
scenario.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 33
! Purpose
! Scenario
! Practice
London
UK11 (LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
VE59
US68 Dakar
VE56
(DKR)
Caracas
(CCS)
Practice Use the following procedures to enter a fact type into an ORM source model.
____________________________________________________________
3. For each object type in the scenario fact types that does not exist in the
Object Types pane, press F2, type object type name, and then press ENTER.
Make sure that you do this for all object types in the scenario.
! Repeat as necessary
Repeat the previous four procedures for each of the fact types in the
scenario.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 35
Lesson Review
Objectives
Objectives
Create
Create aaconceptual
conceptualmodel
model
Classify
Classifyobject
objecttypes
types
Understand
Understand FORML
FORML expressions
expressions
Enter
Enterfact
fact types
typesinto
intothe
the model
modelby
byusing
using the
the
Fact
Fact Editor
Editor
2. In ORM, entities and values will loosely tie into what ER components?
An entity in ORM will become an entity in an ER, or logical, model.
Values in an ORM model will comprise the attributes of an ER model.
36 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
Module Review
3. What are the three primary things you are looking to identify when
examining external information, and why?
Identify fact instances, object types, and unconstrained predicates.
Look for repeating patterns or similar fact instances. You limit the
scope of the UoD by restricting which fact instances you model.
Examine the fact instances for recurring object types. Remember that
object types combine with predicates to form fact types. Look for
common relationships between object types in multiple facts. Fact
instances with occurrences of the same object types and predicates are
often the same fact type.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 37
Scenario For the purposes of this lab, the UoD is limited to the information in this
scenario.
You have been tasked with modeling a database for an academic faculty of a
university. The database will store personal and professional information about
the staff.
! You will not model home phone number information at this time.
! The Dean and all Department Heads have the Rank of Professor.
! The Dean works for the Administration Department.
Linda
LindaSwift
Swift
Dean
Dean
Tenured
Tenured
Gerri
GerriNorton
Norton John
JohnLane
Lane Amber
AmberBeckman
Beckman
Math
MathDept
DeptHead
Head Literature
LiteratureDept
DeptHead
Head History
HistoryDept
DeptHead
Head
Jun
Jun8,8,2003
2003 Tenured
Tenured Tenured
Tenured
James
JamesCalouri
Calouri Paula
PaulaAbels
Abels Troy
TroyFinch
Finch
Professor
Professor Professor
Professor Professor
Professor
Tenured
Tenured Tenured
Tenured Tenured
Tenured
Jeremy
JeremyAlexander
Alexander Vanessa
VanessaThompson
Thompson Ida
IdaCezar
Cezar
Senior
SeniorLecturer
Lecturer Lecturer
Lecturer Senior
SeniorLecturer
Lecturer
Aug
Aug15,
15,2004
2004 June
June8,8,2003
2003 Sep
Sep9,9,2004
2004
John
JohnLane
Lane
Lecturer
Lecturer
May
May25,
25,2003
2003
Figure 2A.1
Employee Location
Location Office
Office phone
phone Home
Employee Home
Employee
Employee name
name Dept
Dept phone
number
number Blg
Blg Room
Room Ext
Ext Access
Access phone
5922
5922 Abels,
Abels, P.
P. Literature
Literature 27
27 78
78 7705
7705 Full
Full NA
NA
7442
7442 Alexander,
Alexander, J. J. Math
Math 27
27 58
58 9497
9497 Local
Local NA
NA
5349
5349 Beckman,
Beckman, A. A. History
History 62
62 151
151 4562
4562 Full
Full 555-3351
555-3351
6961
6961 Calouri,
Calouri, J.J. Math
Math 62
62 39
39 9831
9831 Full
Full NA
NA
4218
4218 Cezar,
Cezar, I.I. History
History 27
27 282
282 4567
4567 Local
Local NA
NA
7947
7947 Finch,
Finch, T.
T. History
History 62
62 53
53 4319
4319 Full
Full NA
NA
5254
5254 Lane,
Lane, J.
J. Literature
Literature 27
27 246
246 2146
2146 Full
Full 555-1967
555-1967
1851
1851 Lane,
Lane, J.
J. Math
Math 62
62 149
149 3991
3991 Local
Local NA
NA
2849
2849 Norton,
Norton, G.G. Math
Math 62
62 151
151 8873
8873 Full
Full 555-6405
555-6405
2350
2350 Swift, L.
Swift, L. Admin
Admin 27
27 150
150 5041
5041 Full
Full 555-6405
555-6405
1689
1689 Thompson,
Thompson, V. V. Literature
Literature 62
62 311
311 5403
5403 Local
Local NA
NA
Figure 2A.2
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 41
Exercise 1
Verbalizing Fact Types
In this exercise, you will catalog the fact types from the Academic Faculty
Theme.
The UoD is limited to the visible contents of Figure 2A.1, the tabular
information in Figure 2A.2, and to the information provided in the scenario.
Use the following procedure and tables to catalog fact types in the scenario.
____________________________________________________________
____________________________________________________________
42 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
____________________________________________________________
2. A single fact instance is provided below. List all other similar fact instances
presented by the information in Figures 2A.1 and Figure 2A.2 in plain
language sentences by using a similar verbal pattern.
James Calouri has Rank of Professor in the Math Department and is
Tenured.
Paula Abels has Rank of Professor in the Literature Department and is
Tenured.
Troy Finch has Rank of Professor in the History Department and is
Tenured.
Linda Swift has Rank of Professor in the Department of Administration
and is Tenured.
Gerri Norton has Rank of Professor in the Math Department and will
be Tenured on June 8th, 2003.
John Lane has Rank of Professor in the Literature Department and is
Tenured.
Amber Beckman has Rank of Professor in the History Department and
is Tenured.
Jeremy Alexander has Rank of Senior Lecturer in the Math
Department and will be Tenured on August, 15th, 2004.
Ida Cezar has Rank of Senior Lecturer in the History Department and
will be Tenured on September 9th, 2004.
John Lane has Rank of Lecturer in the Math Department and will be
Tenured on May 25th, 2003.
Vanessa Thompson has Rank of Lecturer in the Literature Department
and will be Tenured on June 8th, 2003.
____________________________________________________________
____________________________________________________________
What are the high-level similarities and differences in the fact instances?
All Academics have a Rank, regardless of Department.
Rank and job title are not the same thing.
____________________________________________________________
____________________________________________________________
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 43
3. A single-fact instance is provided below. List all other similar fact instances
presented by the information in Figures 2A.1 and Figure 2A.2 in plain
language sentences by using a similar verbal pattern.
Linda Swift is identified by employee number 2350.
Gerri Norton is identified by employee number 2849.
James Calouri is identified by employee number 6961.
Jeremy Alexander is identified by employee number 7442.
Paula Abels is identified by employee number 5922.
Vanessa Thompson is identified by employee number 1689.
Amber Beckman is identified by employee number 5349.
Troy Finch is identified by employee number 7947.
Ida Cezar is identified by employee number 4218.
John Lane in the Math Department is identified by employee number
1851.
John Lane in the Literature Department is identified by employee
number 5254.
____________________________________________________________
____________________________________________________________
What are the high-level similarities and differences in the fact instances?
All Academics have an employee number.
John Lane, who is the Literature Department head, is a different
person from John Lane in the Math Department.
____________________________________________________________
____________________________________________________________
44 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
4. A single fact instance is provided below. List all other similar fact instances
presented by the information in Figures 2A.1 and Figure 2A.2 in plain
language sentences by using a similar verbal pattern.
Linda Swifts office is room 150 in building 27, her extension is 5041, and
she has full phone access.
Gerri Nortons office is room 151 in building 62, his extension is 8873,
and he has full phone access.
James Calouris office is room 39 in building 62, his extension is 9831,
and he has full phone access.
Jeremy Alexanders office is room 58 in building 27, his extension is
9497, and he has local phone access.
John Lanes office is room 149 in building 62, his extension is 3991, and
he has local phone access.
John Lanes office is room 246 in building 27, his extension is 2146, and
he has full phone access.
Paula Abels office is room 78 in building 27, her extension is 7705, and
she has full phone access.
Vanessa Thompsons office is room 311 in building 62, her extension is
5403, and she has local phone access.
Amber Beckmans office is room 151 in building 62, her extension is
4562, and she has full phone access.
Troy Finchs office is room 53 in building 62, his extension is 4319, and
he has full phone access.
Ida Cezars office is room 282 in building 27, her extension is 4567, and
she has local phone access.
____________________________________________________________
____________________________________________________________
What are the high-level similarities and differences in the fact instances?
All employees have an office and a phone.
Some have full phone access; others have only local.
____________________________________________________________
____________________________________________________________
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 45
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1 47
____________________________________________________________
48 Module 2: Analyzing External Information and Creating a Conceptual ModelCSDP Step 1
Exercise 2
Entering Fact Types into the Conceptual Model
In this exercise, you will enter fact types from the Academic Faculty Theme
into the Fact Editor to create a conceptual model. You will use the results of the
previous exercise to complete the exercises below.
The UoD is limited to the visible contents of Figure 2A.1, the tabular
information in Figure 2A.2, and the information provided in the scenario.
Academic heads Department.
Use the following procedures to enter a fact type into an ORM source model.
____________________________________________________________
3. For each object type in the scenario fact type that does not exist in the
Object Types pane, press F2, type object type name, and then press ENTER.
Make sure that you do this for all object types in the scenario.
! Repeat as necessary
Repeat the previous four procedures for each of the fact types in the
scenario.
THIS PAGE INTENTIONALLY LEFT BLANK
Module 3: Drawing a
Conceptual Model and
Entering Sample Data
Contents
CSDP Step 2
Module Overview 1
Lesson: Drawing Fact Types 2
Lesson: Applying a Population Check 11
Lesson: Applying CSDP Step 2 17
Module Review 25
Lab A: Drawing Fact Types and Applying
Population Checks 26
Lab A Discussion: Drawing Fact Types
and Applying Population Checks 32
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 iii
Instructor Notes
Presentation: This module provides students with the skills and knowledge necessary to
60 minutes complete step 2 of the Conceptual Schema Design Procedure (CSDP).
Lab: After completing this module, students will be able to:
30 minutes
! Apply CSDP step 2.
Draw fact types.
Apply population checks.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_03.ppt
Lesson Review
After answering the questions, allow students to openly discuss any of the
topics covered.
Lesson Review
After answering the questions, allow students to discuss openly any of the
topics covered.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 v
Lesson Review
After answering the questions, allow students to discuss openly any of the
topics covered.
Module Review
After answering the questions, allow students to openly discuss any of the
topics covered.
Lab Setup
There are no lab setup requirements that affect replication or customization.
Lab Results
There are no configuration changes on student computers that affect replication
or customization.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 1
Module Overview
Entity Value
Figure 3.1 Figure 3.2
Name
Name
(Reference)
Figure 3.3 Figure 3.4
Role
...
Figure 3.5
Arity
Binary
... ...
Ternary
... ... ...
Quaternary
... ... ... ...
Figure 3.6
Role Connector
Figure 3.7 ...
Predicate Phrase
Figure 3.8 ... has .../... is of ...
Role shape
A role is a part played by an object type in
a relationship.
Roles are symbolized by a rectangle.
Predicate arity
The number of roles involved in a fact
types predicate indicates arity.
A unary predicate has only one role.
A binary predicate has two roles.
A ternary predicate has three roles.
A quaternary predicate has four roles.
Multiple roles are symbolized side-by-side
to form a predicate shape.
6 Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2
Role connector
The line between a role shape and an object
type shape is a role connector. The role
represents the subset of the object types
population that participates in the
relationship.
A role connector spans a single role and a
single object type.
Predicate phrase
The verb phrase with object holes in it
conveys the relationship between the
predicates object types.
The predicate reading is displayed below
the predicate shape, with object names
replaced by ellipses.
Figure 3.9
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 7
Open
Open Business
BusinessRules
Ruleswindow
window
Drag
Drag and
and drop
drop onto
onto the
thedrawing
drawing surface
surface
Examine
Examinedatabase
databaseproperties
propertiesof
ofshapes
shapes
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
! Drag and drop the fact types onto the drawing surface
Drag and drop the Location at Time is used for Subject fact type onto the
drawing surface.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 9
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod03\Answer folder.
10 Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2
Lesson Review
Objectives
Objectives
Draw
Draw fact
facttypes
types
Draw
DrawORM
ORM fact
facttypes
typesin
inVisio
Visio
Describe
Describehow
howfact
facttypes
types are
aresymbolized
symbolizedin
in ORM
ORM
! Representative
! Meaningful variations
Important The subject matter expert or the database modeler should never
make up sample data. Always refer back to real data use cases to obtain actual
data. This has a critical effect on whether or not the model actually reflects
actual business requirements.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 13
Open
Open the
theExamples
Examplestab
tab in
in the
theFact
Fact Editor
Editor
Enter
Enteraameaningful
meaningfulsample
samplepopulation
population
Analyze
Analyzeexample
exampledata
data
Note You will not apply any constraints identified by the population check in
this lesson. Constraints are applied in later CSDP steps.
14 Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Note Ignore the results folder in the Example analysis results window.
Constraints will be covered later in the course.
2. Review the Example analysis results dialog box for messages. If Error or
Warning messages appear, verify that you entered the data exactly as
written, click Close, and then click OK.
Tip If the Analyze report indicates that the population contains blank rows,
most likely more than one numbered blank row appears at the end of the
example data. Click, then right-click the first empty row number, and then
click Delete Rows to remove the extra row. Repeat this action for all but the
last blank row. You must leave one blank numbered row after the last valid
row.
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod03\Answer folder.
16 Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2
Lesson Review
Objectives
Objectives
Apply
Apply aapopulation
populationcheck
check
Implement
Implementaapopulation
populationcheck
check
Describe
Describeaa meaningful
meaningfulsample
samplepopulation
population
Warning Just as data exists in a physical database without your querying it,
elements of the database model exist in the Visio document without your
drawing them. Remember that any drawing that you are viewing may not
represent the entire database model.
Fact types ORM uses two primary shapes to graphically represent fact types. These are the
Object shape and the Predicate shape. All other shapes either enhance or
constrain the meaning of the primary shapes.
Meaningful sample To create an accurate model, you must populate a potential model with
population meaningful sample data. Sample data values are entered into each fact type to
validate that you properly modeled the fact. Visio also uses this sample data to
generate reports and FORML statements.
Important The sample population that you use is meaningful only if it portrays
all variations of fact instances, or examples of unique types of data usage, for a
given fact type that occurs in the UoD. If it does not, you cannot definitively
know whether your model is correct.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 19
Draw
Draw fact
facttypes
types
Examine
Examinedatabase
databaseproperties
propertiesof
ofshapes
shapes
Implement
Implementpopulation
population check
check
Validate
Validate intent
intentwith
with the
the Verbalizer
Verbalizer
London
UK11 (LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
VE59
US68 Dakar
Starting VE56
(DKR)
Model Caracas
(CCS)
2. Implement a population check for the Airline has Flight fact type by using
the data in Table 3.5.
Table 3.5
Airline Flight
AC AC-2331
ED ED-987
AC AC-3899
The Verbalizer text for these two fact types should read as follows:
Airline has Flight / Flight is of Airline
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod03\Answer folder.
22 Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2
London
UK11
(LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
VE59
US68 Dakar
Solution VE56
(DKR)
Model Caracas
(CCS)
Tip If a model becomes visually complex, you may manually arrange the
shapes on the drawing surface. You can flip or rotate predicates by right-
clicking the predicate, pointing to Shape, and then clicking the appropriate
action.
Examine database Notice that this model, like others, does not indicate a reference mode;
properties of shapes however, you can still enter and view example data for each predicate. In ORM,
the example data is used to validate the relationship that the fact type
represents. A reference mode is not required to do so.
Implement a population In this procedure, you entered example data into the Airline has Flight and
check Flight departs from OriginatingCity arrives at TerminatingCity fact types.
You then clicked Analyze to determine whether the fact type had any errors.
In the case of the first fact type, a minimum of three rows of example data is
necessary to express the domain experts statement that an airline may have
multiple flights, but each flight belongs to only one airline. This conforms to
the rule that the number of example data roles must be one more than the
number of roles in the fact type.
The same population rule applies in the second fact type, Flight departs from
OriginatingCity arrives at TerminatingCity. The three roles in this fact type
require a minimum of four rows of example data.
In addition, the data clearly conforms to the intent. It indicates that a flight
travels between an OriginatingCity and a TerminatingCity. For example, flight
ED-987 has an OriginatingCity of Seattle and a TerminatingCity of Denver.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 23
Note that the same flight number, in this case AC-3899 from Table 3.5, is used
more than once. The first time, the flight originates in Boston and terminates in
Chicago. The next portion of this flight originates in Chicago and terminates in
Los Angeles. This represents a flight that has multiple cities in its route.
You may need to enter more data than is required by the number of arity + 1
rule to ensure that the data that is entered fully describes all possible valid
combinations for the model to be accurate.
Finally, Analyze had no entries in the error or warning category, indicating
that, most likely, you have entered the data correctly. You gain a better
confirmation by visually rechecking the data in Table 3.5 and Table 3.6 against
the data that you entered for each fact type.
Validate intent with the The last step is to verbalize the fact types. In this model, the Verbalizer text for
Verbalizer the predicates should read as follows:
Airline has Flight / Flight is of Airline
Flight departs from OriginatingCity arrives at TerminatingCity
These statements also confirm that you have met the intent for the statements
An airline has flights and A flight originates at one city and terminates at
another.
The data supports the intent. The following data is from the Flight departs
from OriginatingCity arrives at TerminatingCity fact type:
Flight departs from OriginatingCity arrives at TerminatingCity
Examples:
Flight AC-2331 departs from OriginatingCity Boston arrives
at TerminatingCity Chicago.
Flight ED-987 departs from OriginatingCity Seattle arrives
at TerminatingCity Denver.
Flight AC-3899 departs from OriginatingCity Boston arrives
at TerminatingCity Chicago.
Flight AC-3899 departs from OriginatingCity Chicago arrives
at TerminatingCity Los Angeles.
It supports the intent that flights depart from one city and terminate in another.
Notice that flight AC-3899 has multiple stops. This supports the intent that a
flight may depart from and terminate at more than two cities during its journey.
24 Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2
Lesson Review
Objectives
Objectives
Apply
Apply CSDP
CSDPstep
step22
Draw
DrawORM
ORM fact
facttypes
typesin
inVisio
Visio
Describe
Describehow
howfacts
factstype
type are
aresymbolized
symbolizedin
in ORM
ORM
Check
Check aafact
fact types
typespopulation
populationusing
using
meaningful
meaningfulsample
sample data
data
Module Review
Scenario You have been given the ORM source model for the Academic Staff and
Departments Theme. You are to draw the fact types, create a population of
meaningful example data with which to check each fact type, and validate the
intent by using the Verbalizer.
The domain expert has told you the following information:
1. A member of the academic staff works for a department.
2. An academic staff member occupies a room for a semester.
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 29
Exercise 1
Drawing ORM Fact Types in Visio
The goal of this exercise is for you to be able to draw ORM fact types in a Visio
model based upon the Academic ORM source model.
Exercise 2
Implementing a Population Check
The goal of this exercise is for you to be able to implement a valid population
check for the Academic model that you have created and the example data that
you have entered.
Exercise 3
Validating the Model
The goal of this exercise is for you to be able to validate that the Academic
model that you have created meets the original intent.
These statements also confirm that you have met the intent of the statements
that a member of the academic staff works for a department and an academic
staff member occupies a room for a semester.
Module 3: Drawing a Conceptual Model and Entering Sample DataCSDP Step 2 33
The data supports the intent. The following data is from the Academic
occupies Room during Semester fact type:
Academic occupies Room during Semester
Examples:
Academic Jones occupies Room 69-301 during Semester
Autumn 2000.
Academic Smith occupies Room 69-406 during Semester
Autumn 2000.
Academic Salmon occupies Room 67-320 during Semester
Autumn 2000.
Academic Jones occupies Room 69-406 during Semester
Winter 2001.
This data contains four examples of vendors and the Academic staff members
and the Room that he or she occupies during a Semester. Notice that the
Academic can be listed more than once, with the corresponding room for any
given semester. The Academic Jones is the example of this. This verifies the
intent.
Although the intent was not explicitly stated, the data supports the fact that a
member of the staff may occupy different rooms for different semesters. When
you discover an implied rule in the example data, you should confirm your
observation with the domain expert.
THIS PAGE INTENTIONALLY LEFT BLANK
Module 4: Trimming the
Conceptual Schema
CSDP Step 3
Contents
Module Overview 1
Lesson: Implementing Primitive Entity
Types 2
Lesson: Implementing Derived Fact Types 14
Lesson: Applying CSDP Step 3 22
Module Review 31
Lab A: Implementing Primitive Entity
Types and Derived Fact TypesCSDP
Step 3 32
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 iii
Instructor Notes
Presentation: This module provides students with the skills and knowledge necessary to
60 minutes complete step 3 of the Conceptual Schema Design Procedure (CSDP).
Lab: After completing this module, students will be able to:
30 minutes
! Apply CSDP step 3.
Implement primitive entities.
Implement derived fact types.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_04.ppt
Lesson Review
After answering the questions, allow students to discuss openly any of the
topics covered.
Lesson Review
After answering the questions, allow students to openly discuss any of the
topics covered.
Lesson Review
After answering the questions, allow students to openly discuss any of the
topics covered.
Module Review
After answering the questions, allow students to openly discuss any of the
topics covered.
vi Module 4: Trimming the Conceptual SchemaCSDP Step 3
Lab Setup
No lab setup requirements affect replication or customization.
Lab Results
No configuration changes on student computers affect replication or
customization.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 1
Module Overview
! Definition
A conceptual partitioning scheme is the systematic
separation of the UoDs population into meaningful
object types
! Characteristics
" Group and division of UoD
" Mutually exclusive partitions
" Exhaustive partitions
Partitioning object types Figure 4.1 represents a generic conceptual partitioning scheme for object types
in the UoD in any given UoD. It shows, moving top to bottom, how all object types are
either entity types or value types, that entity types are either atomic or nested,
and that value types are either strings or numbers. In other words, the
partitioning scheme in Figure 4.1 is exhaustive, in that the entire UoD is
considered, and each subdivision in the partitioning scheme is mutually
exclusive, implying no overlap of object type populations.
Object
Object Types
Types in
in the
the Universe
Universe of
of Discourse
Discourse
Entity
Entity Types
Types Value
Value Types
Types
Atomic
Atomic Nested
Nested
Strings
Strings Numbers
Numbers
Atomic
Atomic Atomic
Atomic Atomic
Atomic
Figure 4.1
Module 4: Trimming the Conceptual SchemaCSDP Step 3 5
! Definition
Primitive entity types represent the most basic entity types
in the UoD
! Characteristics
" Atomic
" Mutually exclusive
Figure 4.2 illustrates a conceptual partitioning scheme that divides object types
in a UoD into primitive entity types. Such a subdivision, by definition, is
exhaustive and mutually exclusive.
Figure 4.2
Primitive entity types are In later CSDP steps, you will see that primitive entity types are the basis for
related to subtypes creating entity subtypes. You may initially recognize primitive entity types in
the UoD as subtypes. At this stage in the CSDP, you should coalesce subtypes
into their primitive forms. Entity subtypes and primitive entity types are related
in the follow manner:
! Subtypes have common primitive entity types.
Subtypes, by definition, share one or more common primitive entity types.
! Subtypes are used differently from one another.
Subtypes are created to allow the placement of differing constraints and
usage of a subset of a given primitive entity types population.
! Subtype populations may overlap.
Unlike a primitive entity type, the populations of its subtypes may overlap.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 7
Common
Commonrelationships
relationships
Common
Common partitioning
partitioning scheme
scheme
Common
Common unit-based
unit-based reference
referencemode
mode
Common
Common primitive
primitiveentity
entitytype
type
Look
Look for
for need
need to
to manipulate
manipulate query
query results
results
Need
Need to
to perform
perform union
unionon
on results
results
Use
Use intersection
intersection of
ofsets
sets to
tocreate
create results
results
Queried together Aside from their representation in ORM, another indication that two or more
object types may share a common primitive entity type is if they are queried
together.
! Union of sets
If you find that you need to combine the results of querying multiple fact
types into a single result set, it is a sign that the object types that you are
querying may share a common primitive entity type.
! Intersection of sets
If you can intersect two or more of the result sets on a common object type,
it is an indication that those object types share a common primitive entity
type.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 9
Identify
Identifyentity
entitytypes
typesto
to be
bereplaced
replaced
Create
Create aanew
new primitive
primitive entity
entitytype
type
Consolidate
Consolidateand
andreassign
reassign entity
entitytypes
types
Eliminate
Eliminateredundant
redundantfact
fact types
types
Validate
Validate the
thenew
new fact
facttypes
types
Tip Do not remove the old entity types from the model at this time. You
may want to use them with entity subtypes in later CSDP steps.
10 Module 4: Trimming the Conceptual SchemaCSDP Step 3
Important Fact types are redundant only if they have exactly the same
relationships and constraints, and are based on the same kind of meaningful
sample populations.
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod04 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
12 Module 4: Trimming the Conceptual SchemaCSDP Step 3
Important Had redundant fact types existed, you would have removed them
from the model while preserving any sample data.
3. On the drawing surface, click the predicate shape for the Meeting ends at
Time fact type. Verify that the following text is displayed in the Verbalizer
window:
Meeting ends at Time
Tip You may select all of the objects and fact types in the model to validate
and open the Verbalizer once. It will contain the statements for all of the
objects and fact types.
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod04\Answer folder.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 13
Lesson Review
Objectives
Objectives
Implement
Implementprimitive
primitiveentity
entitytypes
types
Describe
Describeand
and identify
identify aaconceptual
conceptualpartitioning
partitioning
scheme
scheme
Describe
Describeand
and identify
identify partitioning
partitioning objects
objects
Describe
Describeand
and identify
identify primitive
primitiveentity
entity types
types
Coalesce
Coalesceentity
entity types
types
! Definition
A derived fact type is inferred from roles in other fact types
! Characteristics
" Derivation rule
" Derived vs. derived and stored
" Use of role names
! How derived fact types are symbolized
Note While you can designate whether a derived fact type is stored in an
ORM model, it is really a physical implementation issue.
How derived fact types Derived fact types are symbolized just as any other fact type but with the
are symbolized addition of an asterisk next to the fact types predicate shape. Fact types that are
derived are denoted by a single asterisk at the end of their predicate phrases.
Fact types that are derived and stored are denoted by double asterisks at the end
of their predicate phrases.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 17
Identify
Identifyexisting
existing object
object types
typesand
and fact
fact types
types
Assign
Assign role
rolenames
names
Create
Create aanew
new fact
facttype
type that
thatincorporates
incorporates aanew
new
object
object type
type
Designate
Designatethethe fact
facttype
type as
asderived
derivedand
andassign
assignaa
derivation
derivation rule
rule
Validate
Validate the
thenew
new fact
facttypes
types
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod04 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
Which fact types have roles that can you use to calculate the duration of a
meeting?
Meeting begins at Time.
Meeting ends at Time.
____________________________________________________________
____________________________________________________________
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod04\Answer folder.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 21
Lesson Review
Objectives
Objectives
Implement
Implementderived
derived fact
facttypes
types
Describe
Describeand
and identify
identify role
rolenames
names
Describe
Describederived
derived fact
fact types
typesand
and their
theiruses
uses
Identify
Identifythe
theconceptual
conceptualpartitioning
partitioning scheme
scheme
Implement
Implementprimitive
primitiveentity
entitytypes
types
Identify
Identifyderived
derived data
dataand
andimplement
implementderived
derived fact
fact
types
types
Validate
Validate your
yourintent
intentwith
withthe
theVerbalizer
Verbalizer
Tip Remember to transfer existing sample data from the redundant fact
types to the new derived fact types to assist in validating the model.
! Purpose
! Scenario
! Practice
London
UK11 (LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
VE59
US68 Dakar
Starting VE56
(DKR)
Model Caracas
(CCS)
Practice In this practice, you will apply the steps that you learned in a previous lesson to
the Airline Flights Theme described in the scenario. Refer to those detailed
procedures if you need assistance.
You will use the files in the C:\MOC\2090\Practices\Mod04 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod04\Answer folder.
28 Module 4: Trimming the Conceptual SchemaCSDP Step 3
London
UK11
(LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
VE59
US68 Dakar
Solution VE56
(DKR)
Model Caracas
(CCS)
Identify arithmetically You created a new arithmetically derived fact type to model GMT flight
derived data and departure times, referencing roles in the Flight has local departure Time and
implement derived fact City local time differs by GMTOffset fact types.
types
Because the Time value type appears in more than one fact type that also
includes the Flight entity type, you had to use role names to clearly refer to the
desired role in the derivation rule. The data types of the Time and GMToffset
value types are appropriate for the derivation rule.
The roles used in the derivation rule are valid because all of those roles are
related through a join path through the Flight object type.
Validate intent You coalesced entities that share a common primitive entity type to form the
Flight takes off from City lands in City fact type, as supported by the
following scenario information:
! Each city has flights that both take off and land there.
! You do not need to model any differences between eastbound and
westbound flights, aside from their originating and terminating cities.
You modeled a new Flight has GMT departure Time derived fact type that
calculates GMT time from a flights local time and a citys GMT time zone
offset value, as supported by the following information:
! All flight departure times are stored in local time.
! The time zone offset for each city is available. You need to also calculate,
but not store departure times in GMT.
You then used the text output from the Verbalizer to validate that the
requirements of the scenario were met. You should also reevaluate any example
data that you entered or possibly deleted while applying CSDP step 3.
30 Module 4: Trimming the Conceptual SchemaCSDP Step 3
Lesson Review
Objectives
Objectives
Apply
Apply CSDP
CSDPstep
step33to
toaamodeling
modelingscenario
scenario
Implement
Implementprimitive
primitiveentity
entitytypes
types
Implement
Implementderived
derived fact
facttypes
types
2. Why do you eliminate the use of value types for calculated data?
Properly modeled ORM diagrams do not represent derived data as
value types. A goal of CSDP step 3 is to model all derived data as
derived fact types.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 31
Module Review
5. What is the significance of a fact type with an asterisk next to the predicate
shape?
The presence of an asterisk next to a predicates shape indicates that
the fact type is derived.
32 Module 4: Trimming the Conceptual SchemaCSDP Step 3
For more information The procedures in this lab are a series of directives. If needed, refer to the
practices in the module for detailed implementation instructions. Additionally,
use the appendixes in this course for a symbol guide and a glossary of terms.
Scenario This lab uses the Academic Theme that you are already familiar with. Refer to
the scenario sections of each exercise for more information. An ORM source
model is provided that represents limited information about the academic
faculty of a college, as well as departmental budget information.
You will use the files in the C:\MOC\2090\Labfiles folder to complete this lab.
Solution files for each exercise are in the Answer subdirectory of that folder.
Estimated time to
complete this lab:
30 minutes
Module 4: Trimming the Conceptual SchemaCSDP Step 3 33
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
34 Module 4: Trimming the Conceptual SchemaCSDP Step 3
Exercise 1
Identifying the Conceptual Partitioning Scheme
In this exercise, you will identify a conceptual partitioning scheme by using the
Academic Theme.
Scenario You are tasked with analyzing the information in an ORM source to formulate a
conceptual partitioning scheme.
Tasks
! Look for commonalities among object types and fact types
Open and review the ApplyCSDP3_Academic.vsd ORM source model.
Which object types share a common reference mode?
DepartmentHead, SeniorLecturer, Lecturer, and Professor are all
identified by EmployeeName.
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
Module 4: Trimming the Conceptual SchemaCSDP Step 3 35
____________________________________________________________
____________________________________________________________
What other atomic entity type or types exist in the model in primitive form?
Department.
____________________________________________________________
____________________________________________________________
36 Module 4: Trimming the Conceptual SchemaCSDP Step 3
Exercise 2
Implementing Primitive Entity Types
In this exercise, you will implement primitive entity types in an ORM model by
using the Academic Theme.
Scenario You have identified two primitive entity types that you must implement in an
ORM model.
Tasks ! Implement primitive entity types
1. Create an object type named Academic with a reference mode of
EmployeeNumber.
2. Create an object type named Budget with a reference mode of USD.
3. In all of the fact types that include object types with a reference mode of
EmployeeNumber, replace the referenced object type with Academic.
4. Create and draw a new Academic has Rank fact type to preserve the
distinction in the model between different types of academic employees.
5. Identify the fact type that references TeachingBudget. Change the predicate
phrase to include the word teaching, and replace TeachingBudget with a
new entity type called Budget.
6. Identify the fact type that references ResearchBudget. Change the predicate
phrase to include the word research, and replace ResearchBudget with
the new entity type called Budget.
7. Delete the object types replaced in steps 3-5 from the drawing surface, but
not from the model.
8. Remove redundant fact types from the model.
9. For clarity, reorganize the layout of the shapes on the drawing surface.
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod04\Answer folder.
Module 4: Trimming the Conceptual SchemaCSDP Step 3 37
Exercise 3
Implementing Arithmetically Derived Fact Types
In this exercise, you will implement an arithmetically derived fact type in an
ORM model by using the Academic Theme.
Scenario You are tasked with modifying a regular fact type so that its population is
arithmetically derived and stored in a database.
In this scenario, each department is assigned a teaching budget. A given
departments research budget is determined as a percentage of the teaching
budget. This percentage ratio is known as a departments budget factor.
Tasks ! Identify arithmetically derived data and implement derived fact types
1. Review the example data contained in each of the fact types related to a
departments budget.
2. Assign the role name of TeachingBudget to the Budget role in the fact type
that represents a departments teaching budget.
3. In the fact type that represents a departments research budget, designate a
derivation rule that calculates and stores the research budget of a department
as a percentage of its teaching budget.
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod04\Answer folder.
THIS PAGE INTENTIONALLY LEFT BLANK
Module 5: Adding
Uniqueness Constraints
and Checking Arity of
Fact TypesCSDP
Contents
Step 4
Module Overview 1
Lesson: Implementing Uniqueness
Constraints 2
Lesson: Implementing Nested Object
Types 15
Lesson: Checking Fact Arity 22
Lesson: Applying CSDP Step 4 31
Module Review 40
Lab A: Adding Uniqueness Constraints
and Checking Arity of Fact Types 41
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 iii
Instructor Notes
This module teaches students the Conceptual Schema Design Procedure
(CSDP) step 4. This step covers uniqueness and arity of facts. In the step that
this module covers, students will learn about the concepts of uniqueness
constraints and arity of facts.
Presentation: This module provides students with the necessary knowledge and skills to
60 minutes complete CSDP step 4.
Lab: After completing this module, students will be able to:
30 minutes
! Apply CSDP step 4 to an Object Role Modeling (ORM) model.
Implement uniqueness constraints.
Identify fact arity.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_05.ppt
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to discuss openly
any of the topics covered.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to discuss openly
any of the topics covered.
Practice: Applying CSDP This topic page is for students to practice CSDP step 4 in the Airline Flights
Step 4Airline Flights Theme that they are already familiar with. Allow students the freedom to work
Theme alone, but be available to answer questions.
Discussion:Applying This topic page is intended for you to discuss the steps from the previous topic
CSDP Step 4Airline page. Explain why each task was completed in the manner it was done.
Flights Theme
One or more students may notice that flight DR-342 follows contiguous routes,
Boston to Denver, and Denver to Los Angeles. You may acknowledge that fact,
but ring constraints will be discussed later in the course.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to discuss openly
any of the topics covered.
Module Review
After answering questions, allow students to discuss openly any of the topics
covered.
Lab Setup
There are no lab setup requirements that affect replication or customization.
Lab Results
There are no configuration changes on student computers that affect replication
or customization.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 1
Module Overview
! Definition
A uniqueness constraint prevents duplication of role
instances spanned by the constraint
! Characteristics
" Prevent fact redundancy
" Enforce internal uniqueness
" Enforce external uniqueness
" Enforce functional dependency
! Internal uniqueness
constraint symbol
" Arrow-tipped line
over role shape
" Spans one or more
roles A
Figure 5.1
External uniqueness
constraint symbol
" Dashed line between
roles
Circled U in middle of
U
"
line
" Line connects to roles
in the constraint
Figure 5.9
Examples of external The ORM diagram in Figure 5.10 illustrates an external uniqueness constraint
uniqueness constraints that spans roles in two fact types that share a common object type. The
population of both fact types is restricted to allow the unique combinations of
the two designated roles.
The external uniqueness constraint in Figure 5.10 has the meaning of all
instances of BC are unique in the population of the two facts.
Figure 5.10
Figure 5.11
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 9
Select
Select fact
fact types
types
Determine
Determine whether
whetherto
to use
use an
an internal
internalor
orexternal
external
uniqueness
uniquenessconstraint
constraint
Create
Create the
theuniqueness
uniquenessconstraint
constraint
Validate
Validate the
theuniqueness
uniquenessconstraint
constraint
Tip To help ensure that all fact types in the model are elementary, you
should evaluate placing an explicit uniqueness constraint on every fact type.
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod05 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
____________________________________________________________
Which roles form a unique tuple and are located in the same fact types?
The Meeting role and the second Person role of the Person invites
Person to Meeting fact type will participate in an internal uniqueness
constraint because the roles are in the same fact type.
____________________________________________________________
____________________________________________________________
12 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
____________________________________________________________
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod05\Answer folder.
14 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
Lesson Review
Objectives
Objectives
Implement
Implement uniqueness
uniqueness constraints
constraints
Define
Defineuniqueness
uniquenessconstraints
constraints
Identify
Identifyinternal
internaland
and external
externaluniqueness
uniqueness
constraints
constraintsbybytheir
theirrespective
respectiveshapes
shapes
! Definition
" A nested object type is a fact type that is treated as an
object type and has an internal structure that is
composed of the roles in a fact types predicate
! Characteristics
" Play a role in another fact type
" Used with external constraints between fact types
! How nested objects are symbolized
How nested objects are A nested object type is symbolized by a soft rectangle around the objectified
symbolized predicate shape.
The diagram in Figure 5.12 is an example of a nested entity type in the
Scheduling Scenario. The fact type that represents the relationship between
location, time, and subject has been objectified to create a nested entity type
called class. The student object type participates in a relationship with the
nested entity type called class.
Figure 5.12
Note It is not necessary to use nested object types to model all business
requirements. Alternatively, the diagram in Figure 5.13 is an equivalent
representation of the same business requirements that are represented by the
Class nested object type in Figure 5.12.
Figure 5.13
18 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
Select
Select an
an existing
existingfact
fact type
type
Create
Create aauniqueness
uniquenessconstraint
constraintthat
thatspans
spansall
allroles
roles
Designate
Designatepredicate
predicateas
as aanested
nestedobject
objecttype
typeand
and
assign
assign ititaa name
name
Validate
Validate your
yourintent
intentwith
withthe
theVerbalizer
Verbalizer
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod05 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
3. On the drawing surface, click the nested object shape for the Invitation
object type. Verify that the following text is displayed somewhere in the
Verbalizer window:
Invitation is an entity object type.
Invitation is an alias for the nested fact type 'Person
is asked to attend Meeting'
4. On the drawing surface, click the predicate shape for the Person sends
Invitation fact type. Verify that the following text is displayed somewhere
in the Verbalizer window:
Person sends Invitation
For each Invitation i, at most one Person sends
Invitation i.
If needed, review the solution files for this practices located in the
C:\MOC\2090\Practices\Mod05\Answer folder.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 21
Lesson Review
Objectives
Objectives
Implement
Implement nested
nested object
object types
types
Define
Definenested
nestedobject
objecttypes
types
2. How are nested object types used differently from ordinary object types?
Nested object types are relationships that are treated as an object type.
In all other respects, they are identical to ordinary object types.
22 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
! Definition
A key length check ensures that a fact type with an arity of
2 or more has an explicit internal uniqueness constraint
that spans at least n-1 roles in the predicate
! Characteristics
" Number of roles is the key length
" Required by elementary fact types
" Split fact type if check fails
Presence
Presence of
of redundant
redundant instances
instances
Invalid
Invalid key
key length
length
Presence
Presence of
of verbal
verbal conjunctions
conjunctions
Fact
Fact type
type is
is not
not elementary
elementary
Important Continue to check whether you should split each successive fact
type division until all resultant fact types are elementary.
Presence of redundant Check uniqueness constraints against meaningful sample data, and if possible,
instances actual data. Sample fact instances that repeat indicate that the fact type is not
elementary, or that the uniqueness constraints are incorrect or incomplete.
Invalid key length The number of roles in an internal uniqueness constraint indicates the key
length of that fact type. The key length rule states that the minimum valid
length of at least one key on a fact type is one less than the arity of the fact type.
If the key length is not valid, then the fact type is not elementary.
Presence of verbal Verbalize the fact type and look for the use of conjunctions in the FORML
conjunctions expression. If there is a conjunction between two objects with differing
primitive entity types, your fact type is not elementary.
Fact type is not The reason for splitting a fact type is because it is not elementary. Remember
elementary that, although it is not modeled, elementary fact types have an implied
uniqueness constraint spanning all roles in the fact type, meaning that all fact
type instances are unique.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 25
Break
Break into
into elementary
elementary facts
facts
Preserve
Preserve constraints
constraints
Preserve
Preserve sample
sample data
data
Preserve
Preserve meaningful
meaningful relationships
relationships
Tip You may duplicate a role from the original fact type in two or more new
fact types that were formed during a split. Remember that a role is just a case of
an object type being used in a particular way in a fact type.
Preserve constraints Always preserve the constraints placed on roles in the original fact type. These
constraints are there to represent the UoD accurately and to provide important
clues as to how to break the fact type down properly. You will compare
constraints in the original fact type with the ones in the new fact types that you
create to validate that you have not lost information in your model.
Note You should not break apart the roles spanned by internal uniqueness
constraints in a new fact type. However, you can duplicate them.
26 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
Preserve sample data You should have entered a meaningful sample population into the fact type that
you are splitting. Remember that the data in the columns in the sample data
table is associated with the roles in the fact type. If you opt to move a role into
another fact type during the split, you should also transfer the sample data that
goes with that role.
Preserve meaningful Remember that a fact type represents instances of a relationship between object
relationships types. The roles in the fact type were originally grouped together because you
observed them that way in the UoD. Before splitting roles up, ask yourself if
their individual meanings are the same as their joint meaning.
Note You can also view this as the need to preserve functional dependencies of
one role or roles with another role in the same fact type.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 27
Create
Create new
newfact
facttypes
types by
byusing
usingthe
thesame
sameobject
object
types
types
Apply
Apply old
old constraints
constraints to
tonew
new fact
facttypes
types
Copy
Copy and
andpaste
pastesample
sampledata
datacolumns
columns
Validate
Validate new
new fact
fact types
typesand
andconstraints
constraints
Remove
Removethe
theold
old fact
fact type
typefrom
from the
themodel
model
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod05 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
! Remove the old fact type from the drawing surface and the model
Remove the Person invites Person to Meeting located at Venue fact type
from the model.
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod05\Answer folder.
30 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
Lesson Review
Objectives
Objectives
Describe
Describe fact
factarity
arity and
and how
how itit is
is used
used
Define
Definekey
key length
length check
check
Describe
Describehow
howto
to split
split fact
facttypes
types
Implement
Implementuniqueness
uniquenessconstraints
constraints
Check
Checkfor
forsufficient
sufficientcause
causeto
to split
split fact
facttypes
types
IfIf indicated,
indicated,split
splitfact
fact types
types
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
Important You should use Visio to conceptually validate the ORM model
after all remaining CSDP steps. During this process, Visio checks for illegal
constructs in ORM; it does not check whether you have captured business
requirements appropriately.
34 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
! Purpose
! Scenario
! Practice
London
UK11 (LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
Starting
VE59
US68 Dakar
VE56
(DKR)
Model Caracas
(CCS)
Practice You will use the files in the C:\MOC\2090\Practices\Mod05 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
____________________________________________________________
Note You should always use actual data values for sample data. In this
practice, the actual values should have been string concatenations of the
Location nested object types constituent role values; that is, Airport,
Terminal, Gate combinations.
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod05\Answer folder.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 37
London
UK11 (LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
Solution
VE59
US68 Dakar
VE56
(DKR)
Model Caracas
(CCS)
Validate your intent with You prevented redundant instances of the Airport has Terminal has Gate fact
the Verbalizer type by creating a uniqueness constraint across the Airport, Terminal, and
Gate roles to enforce the scenario requirement of:
! Multiple airports may have the same terminal codes and gate numbers, but
each is a unique location.
In addition to preserving the uniqueness constraints while splitting the fact type,
you also preserved the functional dependency through the use of a nested object
type in the Flight is grounded at Location fact type, as indicated by the
scenario requirement:
! A flight may be at only one location, and each location may have a single
flight. A flight on the ground is functionally dependent on its location.
Through a key-length check of the new fact types and proper modeling of
functional dependencies, you ensured that all fact types are elementary. You
then used the text output from the Verbalizer to validate that the model captured
your intent.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 39
Lesson Review
Objectives
Objectives
Apply
Apply CSDP
CSDP step
step 44 to
to an
an ORM
ORM model
model
Describe
Describehow
howto
toadd
add uniqueness
uniquenessconstraints
constraints
Describe
Describehow
howto
to split
split fact
facttypes
types
Validate
Validatethe
theORM
ORMmodel
model
Module Review
For more information The procedures in this lab are a series of directives. If needed, refer to the
practices in the module for detailed implementation instructions. Additionally,
use the appendixes in this course for a symbol guide and a glossary of terms.
Scenario This lab uses the Academic Theme that you are already familiar with. Refer to
the scenario sections of each exercise for more information. An ORM source
model is provided that represents limited information about the academic
faculty of a college, as well as departmental budget information.
You will use the files in the C:\MOC\2090\Labfiles\Lab05A folder to complete
this lab. Solution files for each exercise are in the Answer subdirectory of that
folder.
Estimated time to
complete this lab:
30 minutes
42 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 43
Exercise 1
Implementing Uniqueness Constraints
In this exercise, you will identify a conceptual partitioning scheme by using the
Academic Theme.
Scenario For the purposes of this exercise, the UoD is limited to the information in this
scenario.
You are given the task of implementing uniqueness constraints in an ORM
source model. In this exercise, do not change any of the fact types beyond
adding uniqueness constraints.
! For each subject that an Academic teaches, the Academic gets at most one
rating. The rating is only given if he or she teaches a subject.
! Each academic has at most one rank code, and if he or she does have a rank
code, they have at most one access level code.
Tasks
! Identify fact types
1. Open and review the ApplyCSDP4_Academic.vsd ORM source model.
2. Review the example data contained in each of the fact types.
Which fact types and roles are related to the uniqueness constraints
prescribed in the scenario?
In the Academic teaches Subject gets Rating fact type, the combination
of Subject and Rating is unique.
In the Academic has Rank and has AccessLevel fact type, the Academic
role is unique, and the Rank role is unique.
____________________________________________________________
____________________________________________________________
____________________________________________________________
What is the text that the Verbalizer displays for the Academic has Rank
and has AccessLevel fact type?
Academic has Rank and has AccessLevel
*** Invalid uniqueness constraint or Fact is not
elementary!
*** Invalid uniqueness constraint or Fact is not
elementary!
____________________________________________________________
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod05A\Answer folder.
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 45
Exercise 2
Checking the Arity of Fact Types
In this exercise, you will check the arity of each fact type for sufficient cause in
an ORM model to split the fact type into new elementary fact types by using the
Academic Theme.
Scenario All applicable uniqueness constraints have been placed on fact types in an
ORM model.
You will use the model that you modified in the previous exercise to complete
this practice. Alternatively, use the ImplUnique_Academic_Answer.vsd ORM
source model in the C:\MOC\2090\Labfiles\Mod05A\Answer folder.
Tasks
! Perform key length check
1. Examine the Academic teaches Subject gets Rating fact type.
What is the minimum valid key length for the fact type?
It is 2, or the arity of the fact type minus 1.
____________________________________________________________
____________________________________________________________
Is there a uniqueness constraint on the fact type that spans the minimum
number of rows?
Yes, over the Academic and Subject roles.
____________________________________________________________
____________________________________________________________
2. Examine the Academic has Rank and has AccessLevel fact type.
What is the minimum valid key length for the fact type?
It is 2, or the arity of the fact type minus 1.
____________________________________________________________
____________________________________________________________
Is there a uniqueness constraint on the fact type that spans the minimum
number of rows?
No, the uniqueness constraints are each over a single role.
____________________________________________________________
____________________________________________________________
46 Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4
____________________________________________________________
2. Examine the sample data for the Academic has Rank and has AccessLevel
fact type.
Between any two or more columns, are there any redundant tuples?
Yes, between the Rank and AccessLevel columns, the tuples (P, Full),
(SL, Local), and (L, Local) each have duplicate instances.
____________________________________________________________
____________________________________________________________
Module 5: Adding Uniqueness Constraints and Checking Arity of Fact TypesCSDP Step 4 47
Exercise 3
Splitting Fact Types
In this exercise, you will reformulate a fact type that needs to be split in an
ORM model into new elementary fact types by using the Academic Theme.
Scenario You are tasked with implementing fact type splits that were indicated in the
previous exercise.
You will use the model that you modified in the previous exercise to complete
this practice. Alternatively, use the ImplUnique_Academic_Answer.vsd ORM
source model in the C:\MOC\2090\Labfiles\Mod05A\Answer folder.
Tasks
! Reformulate new fact types
1. Create new fact types as indicated by the previous exercise, and transfer the
relevant sample data into each fact type.
2. Objectify any fact type as needed to preserve functional dependencies
across compound uniqueness constraints in new fact types.
Tip To validate example data when a nested object type does not have a
reference mode of its own, enter text that represents each objectified tuple
into the nested role of a new fact type.
3. Create uniqueness constraints on the new fact types that correspond to those
that exist on the old fact types.
4. Validate the new fact types by examining and analyzing their example data.
Verify that all fact types are elementary and that all new uniqueness
constraints are complete and valid.
5. Remove the old fact types from the model.
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod05A\Answer folder.
THIS PAGE INTENTIONALLY LEFT BLANK
Module 6: Adding
Mandatory Role
Constraints and Checking
for Logical Derivations
Contents
CSDP Step 5
Module Overview 1
Lesson: Implementing Mandatory Role
Constraints 2
Lesson: Implementing a Primary
Reference Scheme 18
Lesson: Checking for Logically Derivable
Fact Types 31
Lesson: Applying CSDP Step 5 38
Module Review 47
Lab A: Adding Mandatory Role Constraints
and Checking for Logical Derivations 48
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 iii
Instructor Notes
This module teaches students the Conceptual Schema Design Procedure
(CSDP) step 5. This step covers mandatory constraints, primary reference
schemes, and checking for logically derived fact types.
Presentation: This module provides students with the necessary knowledge and skills to
60 minutes complete CSDP step 5.
Lab: After completing this module, students will be able to:
45 minutes
! Complete CSDP step 5.
Implement mandatory constraints.
Implement a primary reference scheme.
Avoid modeling logically derivable fact types.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_06.ppt
Independent Object This page describes modeling object types and their roles, where there is a
Types special classification for object types whose instances can exist outside of any
fact types.
What Are Mandatory This page defines mandatory role constraints and lists the characteristics
Role Constraints? common to all mandatory role constraints in an Object Role Modeling (ORM)
model.
Guidelines for This page covers the guidelines used when implementing mandatory role
Implementing Mandatory constraints.
Role Constraints
How to Implement This page covers the sub-tasks for implementing mandatory role constraints.
Mandatory Role
Constraints
Practice: Implementing This page reinforces the elements of the previous page through practice of the
Mandatory Role procedure by using the Scheduling Theme.
Constraints
Scheduling Theme
What Are Disjunctive This page defines disjunctive mandatory role constraints and lists the
Mandatory Role characteristics common to all mandatory role constraints in an ORM model.
Constraints? Make sure that students understand the subtle differences between mandatory
and disjunctive mandatory constraints.
Guidelines for This page covers the guidelines used when implementing disjunctive mandatory
Implementing role constraints.
Disjunctive Mandatory
Role Constraints
How to Implement This page covers the sub-tasks for implementing disjunctive mandatory role
Disjunctive Mandatory constraints.
Role Constraints
Practice: Implementing This page reinforces the elements of the previous page through practice of the
Disjunctive Mandatory procedure by using the Scheduling Theme.
Role Constraints
Scheduling Theme
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 v
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to discuss openly
any of the topics covered.
How to Implement a This page covers the sub-tasks for implementing a primary reference scheme.
Primary Reference
Scheme
Practice: Implementing a This page reinforces the elements of the previous page through practice of the
Primary Reference procedure by using the Scheduling Theme. Make sure that you point out that in
SchemeScheduling the Formal Object Role Modeling Language (FORML) expression at the end of
Theme this page, an asterisk by the line indicates the primary reference scheme.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to discuss openly
any of the topics covered.
vi Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to discuss openly
any of the topics covered.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to discuss openly
any of the topics covered.
Module Review
After answering the questions, allow students to discuss openly any of the
topics covered.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 vii
Lab Setup
There are no lab setup requirements that affect replication or customization.
Lab Results
There are no configuration changes on student computers that affect replication
or customization.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 1
Module Overview
A, B Subset
Subset of
of
Role
Role
A, C A, C Person
Person
Population
Population
Population
B, C Population
resides in
Person
Subset
Subset of
of
Role
Role
B, C Person
Person
Population
Union
Union of
ofRole
Role Population
Population
Figure 6.1 Population
Instances
Instances
works for
11 2 33
A A
D D
B Instance
Instance Is
Is
B
E Not
Not In
In Roles
Roles
Population
Population
C C
Figure 6.2 Figure 6.3
! Definition
A mandatory role constraint forces all instances of an
object type to participate in a given role. Reference
roles are always mandatory
! Characteristics
" Global nature
" Implied with functional dependency
! FORML expression
FORML expression Mandatory role constraints are expressed in Formal Object Role Modeling
Language (FORML) notation by the inclusion of the word Each in front of an
object type. In the FORML expression,
Each Person has Name
The word Each indicates that the Person role in the fact type has a mandatory
role constraint on it, and that the name of each instance of the object type
Person is known.
How mandatory role A mandatory role constraint is symbolized by a solid round dot at the end of the
constraints are line that connects a role shape to an object type shape.
symbolized
In Figure 6.4, notice the solid round dot on the object type end of the role
connector for Person, indicating that the entire population of the Person object
type participates in the fact type.
Figure 6.4
Tip The majority of all fact types that you are likely to encounter while
modeling business requirements will have the same structure and constraints as
the fact type in Figure 6.4.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 7
Rarely
Rarely apply
apply to
to nonfunctional
nonfunctional roles
roles
Make
Make aa role
role mandatory
mandatory ifif and
and only
only ifif needed
needed
Identify
Identifythe
theroles
rolesto
to make
makemandatory
mandatory
Add
Add an
an internal
internalmandatory
mandatoryrole
roleconstraint
constraint
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod06 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
10 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod06\Answer folder.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 11
! Definition
A disjunctive mandatory role constraint is an inclusive-or
constraint that applies to a set of two or more roles
! Characteristics
" Multi-role mandatory role constraint
" Connected to the same object type
" Instance must participate in at least one role
! FORML expression
! How Disjunctive Role Constraints Are Symbolized
FORML expression Disjunctive mandatory role constraints are expressed in FORML notation by
noting that each object type participates in one relationship or another.
Each Employee works in some Office or has some MobilePhone.
Note Although the FORML expression only connects the relationships with
the word =or, disjunctive mandatory roles actually mean either-or, or both.
12 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
How disjunctive role A disjunctive role constraint is symbolized by a small circle with a smaller solid
constraints are dot in it, and a dashed line connecting each of the roles spanned by the
symbolized constraint to the circle, as shown in Figure 6.5.
Figure 6.5
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 13
Draw
Draw duplicate
duplicate fact
fact type
type shapes
shapes as
as needed
needed
Explicitly
Explicitly declare
declare ifif itit will
will still
still apply
apply ifif more
more roles
roles are
are added
added
Determine
Determine the
the mandatory
mandatory role
roledisjunction
disjunction
Add
Add aa mandatory
mandatoryrole
role constraint
constraint across
acrosstwo
two or
ormore
more
roles
roles
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod06 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
16 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
____________________________________________________________
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod06\Answer folder.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 17
Lesson Review
Objectives
Objectives
Implement
Implement mandatory
mandatory role
role constraints
constraints
Identify
Identifypopulations
populationsof
of roles
rolesand
and object
object types
types
Describe
Describemandatory
mandatoryconstraints
constraintsand
and their
theiruses
uses
Describe
Describedisjunctive
disjunctivemandatory
mandatoryconstraints
constraints
and
and their
theiruses
uses
! Global means
! Candidate identifiers
! Primary reference scheme
Candidate
Candidate Candidate
Candidate Candidate
Candidate Candidate
Candidate
Identifier
Identifier Identifier
Identifier Identifier
Identifier Identifier
Identifier
Emp
Emp Employee
Employee Dept
Dept Location
Location Phone
Phone Tenured/
Tenured/
num
num name
name nontract-
nontract-
Blg
Blg Room
Room Ext
Ext Access
Access expiry
expiry
715
715 Adams A Computer
Computer Science
Science 69
69 301 2345
2345 LOC
LOC 01/31/95
01/31/95
720
720 Brown TT Biochemistry
Biochemistry 62
62 406 9642
9642 LOC
LOC 01/31/95
01/31/95
139
139 Cantor
Cantor G
G Mathematics
Mathematics 67
67 301 1221
1221 INT
INT Tenured
Tenured
430
430 Codd
Codd EF
EF Computer
Computer Science
Science 69
69 507 2911
2911 INT
INT Tenured
Tenured
Figure 6.6
1 22 3
! Definition
A simple reference scheme uses instances of a single
value type to identify an entity type
! Characteristics
" Implied binary fact type
" Mandatory role
" Simple uniqueness constraint
! FORML expression
! How symbolized P
Person
Person Name
(Name)
is identified by
Figure 6.7 Figure 6.8
FORML expression The syntactical expression of a simple reference scheme notes that every entity
instance is identified by one distinct value instance.
For example, the FORML expression for a Person entity type that has a simple
reference scheme that identifies instances by a persons name is:
Every Person is identified by one distinct Name.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 21
How simple reference Simple reference schemes are visually indicated by an entity type reference
schemes are symbolized mode, or by a fact type that has uniqueness constraints that enforce a one-to-one
or more relationship combined with a mandatory role constraint. If the
reference mode is primary, then the letter P is superimposed over the
uniqueness constraint.
Figures 6.7 and 6.8 both graphically indicate the same simple primary reference
scheme.
Figure 6.7
Figure 6.8
22 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
! Definition
A compound reference scheme uses the unique
population of a related group of roles to identify an
entity type
! Characteristics
" Tuple based
" Implied mandatory
" Uniqueness constraint spans identifying roles
! FORML expression
Note The domain expert may have indicated that a given combination of
roles was unique anyway. But the combination of roles needs to have the
preceding characteristics in order to use it for identification purposes.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 23
FORML expression The syntax of a simple reference scheme notes that every entity instance is
identified by at most one distinct tuple instance.
For example, the FORML expression for a Person entity type that has a
compound reference scheme that identifies instances by the unique combination
of first name, last name, birthday, and birthplace is:
External FORML expression:
For each FirstName f, LastName l, Date d and PlaceOfBirth p
there is at most one Person that
has FirstName f and has LastName l and was born on Date d
and was born in PlaceOfBirth p.
Person is primarily identified by this unique combination.
How compound The diagram in Figure 6.9 illustrates the use of an external uniqueness
reference schemes are constraint that is used as a compound primary reference scheme for identifying
symbolized an instance of Person. Notice that the letter U in the external uniqueness
constraint shape is replaced with the letter P to indicate that the uniqueness
constraint is the primary reference scheme.
Figure 6.9
Notice that it is possible to associate more than one instance of any of the other
object types with Person. This diagram allows multiple combinations of the
identifying roles to be captured, but only allows one unique combination of
those to exist.
24 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
Figure 6.10
Where
Where applicable,
applicable, use
use reference
reference mode
mode
Minimize
Minimize the
the number
number of
of roles
roles
Favor
Favor stable,
stable, rigid
rigid identifiers
identifiers
Be
Be wary
wary of
of information
information bearing
bearing identifiers
identifiers
Decompose
Decompose information
information bearing
bearing identifiers
identifiers
Normalize
Normalize units
units of
of measurement
measurement
Minimize the number of The larger the number of roles needed to identify an entity, the more doubtful it
roles is that they are all accurate or necessary.
Favor stable, rigid When implementing your database, you must have stable identifiers assigned to
identifiers all elements of the model. Select identifiers that are stable and are not subject to
significant change.
For example, a persons phone number is not a good choice for a primary
reference scheme, because the phone number may change from time to time.
Be wary of information Identifiers that convey meaning of what the data represents are usually not
bearing identifiers primitive object types. More often than not, this is a compound reference
scheme where the identifiers are stable.
For example, in a university, all mathematics courses are prefixed with the
letters MAT, and all courses in biology are prefixed with the letters BIO. The
significance of the letters is apparent to a student who is registering for classes.
Decompose information Do not use concatenated information bearing identifiers in a single fact type.
bearing identifiers You may need to use the component parts separately in other fact types, or
query them separately.
For example, if a classrooms location is identified by the combination of
building number and room number, you should model these as two fact types,
and create an external uniqueness constraint between the two to use as a
primary reference scheme.
Normalize units of Use a common unit of measurement for like object types. Do not measure one
measurement object type in U.S. dollars and another in euros when they are both sums of
money. Use a derivation rule to normalize the numbers.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 27
Determine
Determinecandidate
candidateidentifiers
identifiers
Implement
Implementaa uniqueness
uniquenessconstraint
constraint or
orentity
entitytype
type
reference
reference mode
mode
Designate
Designatethe
the UC
UCas
as the
theprimary
primaryreference
referencescheme
scheme
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod06 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 29
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod06\Answer folder.
30 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
Lesson Review
Objectives
Objectives
Implement
Implement aa primary
primary reference
reference scheme
scheme
Describe
Describerequirements
requirementsfor
foridentification
identification of
of
entity
entity types
types
Describe
Describesimple
simplereference
reference schemes
schemesand
and their
their
uses
uses
Describe
Describecompound
compound reference
referenceschemes
schemesand
and
their
theiruses
uses
! Definition
Object types exhibit a transitive
implied relationship when an
unbroken chain of comparable
relationships is formed
spanning a series of object
types
! Characteristics
" Use in logic and mathematics
" Conducts characteristics
! Examples
" If X =Y and Y = Z, then X = Z
" If X > Y and Y > Z, then X > Z
" If X is like Y and Y is like Z,
then X is like Z
1 22 3 Figure 6.11
Important Transitive relationships are the basis for nearly all implied
constraints in an ORM model. It is critical that you have a thorough
understanding of them.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 33
! Example 2:
If Manuels salary is greater than Moes, and Moes salary is greater than
Jacks, then Manuels salary is greater than Jacks.
! Example 3:
If driving a car is like driving a van and driving a van is like driving a
truck, then driving a car is like driving a truck.
! Definition
The information in a logically derivable fact type is inferred from other
fact types. Logically derivable fact types are typically based upon
related but separate elementary fact types
! Characteristics
" Usually contain hidden information
" Not normally shown on diagram
" All explicit constraints are normally derivable
" Relationships that are transitively implied from other relationships
Caution Be careful not to confuse logically derivable fact types with fact
types that are not using primitive entity types. You should have dealt with
primitive entity types in CSDP step 3. The act of breaking object types up
into primitive entity types frequently breaks up logically derived fact types,
as well.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 35
Note This is the main reason that you can logically derive some fact types.
How logically derivable Aside from the derivation notation, there is no special symbology for logically
fact types are derived fact types. They may appear on the drawing surface just as any other
symbolized fact type, or not at all. Logically derivable fact types are correctly symbolized
when all of their constituent fact types and constraints are themselves
symbolized.
Example Figure 6.12 illustrates a logically derivable fact type. Notice that there is a
circular chain of fact types, creating more than one path to retrieve data.
Figure 6.12
Important When properly modeled, you should have a single join path by
which it is possible to retrieve data on a given role.
36 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
Look
Look for
for other
other relationships
relationships of
of interest
interest between
between fact
fact types
types
Look
Look for
for derivable
derivable constraints
constraints
Look
Look for
for circular
circular relationship
relationship chains
chains
Lesson Review
Objectives
Objectives
Avoid
Avoid modeling
modelinglogically
logically derivable
derivable fact
fact types
types
Describe
Describetransitively
transitively implied
implied relationships
relationships
Describe
Describelogically
logicallyderivable
derivable fact
facttypes
types
Implement
Implementmandatory
mandatoryrole
roleconstraints
constraints
Implement
Implementprimary
primaryreference
referenceschemes
schemes
Check
Checkfor
forlogically
logically derivable
derivablefact
fact types
types
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
London
UK11
(LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO
Atlanta 3 US62 )
VE56
(ATL)
Starting US6
8
VE59
VE56
Dakar
(DKR)
Model Caracas
(CCS)
Practice You will use the files in the C:\MOC\2090\Practices\Mod06 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
____________________________________________________________
2. Remove the Country has Airport fact type from the drawing surface and
the model.
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 43
City is in Country
Each City is in some Country.
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod06\Answer folder.
44 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
London
UK11
(LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO
Atlanta 3 US62 )
VE56
(ATL)
Solution US6
8
VE59
VE56
Dakar
(DKR)
Model Caracas
(CCS)
Check for logically Because it was logically derivable through other fact types, you removed the
derivable fact types Country has Airport fact type. The reason that the fact type was logically
derivable was that its information was available through transitively implied
relationships with other fact types. Also, Airport is directly functionally
dependent on City, but it was not directly functionally dependent on Country.
The presence of multiple join paths from the Airport object type to the
Country object type was an indication to examine the involved fact types for
possible logically derivable fact types.
Validate the ORM model The need for the mandatory role constraints were indicated by the scenario
and your intent requirement:
! Each city is in some country and has one or more airports.
The use of a reference mode on the Airport entity type as its primary reference
scheme was justified by the requirements:
! All airports have a unique three letter code.
! When the information is available, you can refer to an airport by the
combination of the city it is in and its name.
You then used the text output from the Verbalizer to validate that the
requirements of the scenario were met. You should also re-evaluate any
example data that you entered or possibly deleted while applying CSDP step 5.
46 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
Lesson Review
Objectives
Objectives
Apply
Apply CSDP
CSDP step
step 55
Implement
Implementmandatory
mandatory role
roleconstraints
constraints
Implement
Implementprimary
primaryreference
referenceschemes
schemes
Check
Check for
forlogically
logicallyderivable
derivablefact
fact types
types
Validate
Validateyour
yourintent
intent with
withthe
theVerbalizer
Verbalizer
Module Review
For more information The procedures in this lab are a series of directives. If needed, refer to the
practices in the module for detailed implementation instructions. Additionally,
use the appendixes in this course for a symbol guide and a glossary of terms.
Scenario This lab uses the Academic Theme that you are already familiar with. Refer to
the scenario sections of each exercise for more information. An ORM source
model is provided that represents limited information about the academic
faculty of a college and departmental budget information.
You will use the files in the C:\MOC\2090\Labfiles\Lab06A folder to complete
this lab. Solution files for each exercise are in the Answer subdirectory of that
folder.
Estimated time to
complete this lab:
45 minutes
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 49
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
50 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
Exercise 1
Implementing Mandatory Role Constraints
In this exercise, you will implement mandatory role constraints by using the
Academic Theme.
Scenario For the purposes of this exercise, the UoD is limited to the information in this
scenario.
You are tasked with implementing uniqueness constraints in an ORM source
model. In this exercise, do not change any of the fact types other than adding
mandatory or disjunctive mandatory role constraints.
! You must record a phone number, the first name, the last name, and the
department that every academic works for.
! Every department knows who works for it and who heads the department.
! Every department heads phone number is known.
Tasks
! Identify the roles to make mandatory
Open and review the ApplyCSDP5_Academic.vsd ORM source model.
According to the scenario requirements, which object types will have a
mandatory role in a fact type?
Academic and Department.
____________________________________________________________
____________________________________________________________
Which roles of which fact types should have mandatory role constraints?
The Academic role of the Academic has PhoneNumber, Academic has
FirstName, Academic has LastName, and the Academic works for
Department fact types.
The Department role for the Academic works for Department,
Academic heads Department, and the Department has head with home
PhoneNumber fact types.
____________________________________________________________
____________________________________________________________
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod06A\Answer folder.
52 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
Exercise 2
Implementing Primary Reference Schemes
In this exercise, you will consider primary reference scheme candidates and
implement one for an object type in an ORM model by using the Academic
Theme.
Scenario All applicable uniqueness constraints have been placed on fact types in an
ORM model. Designate the proper uniqueness constraint or constraints as a
primary reference scheme.
You will use the model that you modified in the previous exercise to complete
this practice. Alternatively, use the ImplMandatory_Academic_Answer.vsd
ORM source model in the C:\MOC\2090\Labfiles\Mod06A\Answer folder.
! The unique combination of an academics first name, last name, and the
department that he or she works for could identify the academic. Academics
typically do not change departments frequently.
! Every academic has a phone number that is not shared with anyone else.
Phone numbers are reused when an academic no longer works for the
university, or when the person changes departments.
Tasks
! Determine candidate identifiers
Examine all 1:1 uniqueness constraints in which the Academic object type
plays a role.
According to the scenario requirements, which object types can you use to
identify an academic?
The combination of FirstName, LastName, and Department.
PhoneNumber.
____________________________________________________________
____________________________________________________________
____________________________________________________________
Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5 53
____________________________________________________________
____________________________________________________________
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod06A\Answer folder.
54 Module 6: Adding Mandatory Role Constraints and Checking for Logical DerivationsCSDP Step 5
Exercise 3
Checking for Logically Derivable Fact Types
In this exercise, you will identify and remove a logically derivable fact type
from an ORM model by using the Academic Theme.
Scenario You are tasked with avoiding the use of logically derivable fact types in an
ORM model.
You will use the model that you modified in the previous exercise to complete
this practice. Alternatively, use the ImplReference_Academic_Answer.vsd
ORM source model in the C:\MOC\2090\Labfiles\Mod06A\Answer folder.
Tasks
! Identify and remove logically derivable fact types
1. Examine the relationships between the object types in the model.
Which object types are involved in a circular relationship?
Academic, PhoneNumber, and Department.
____________________________________________________________
____________________________________________________________
____________________________________________________________
2. Remove the fact type from the model that is logically derivable from other
fact types.
Which fact type was removed?
Department has head with home PhoneNumber.
____________________________________________________________
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod06A\Answer folder.
Module 7: Adding Value
and Set Constraints,
and Creating Entity
SubtypesCSDP
Contents
Step 6
Module Overview 1
Lesson: Implementing Value Constraints 2
Lesson: Implementing Set Constraints 11
Lesson: Implementing Entity Subtypes 21
Lesson: Applying CSDP Step 6 36
Module Review 46
Lab A: Adding Value Constraints, Set
Constraints, and Entity Subtypes 47
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 iii
Instructor Notes
This module teaches students the Conceptual Schema Design Procedure
(CSDP) step 6. This step covers adding three types of constraints: value
constraints, set constraints, and subtype constraints.
Presentation: This module provides students with the necessary knowledge and skills to
60 minutes complete CSDP step 6.
Lab: After completing this module, students will be able to:
30 minutes
! Complete CSDP step 6.
Implement value constraints.
Implement set constraints.
Implement entity subtypes.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_07.ppt
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
What Are Set This page defines and describes set constraints and then provides examples of
Constraints? how they are used.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 v
How Set Constraints Are This page covers the ORM specific symbology of set constraints.
Represented
How to Implement Set This page teaches students the high-level steps of how to implement a set
Constraints constraint.
Practice: Implementing This page reinforces the elements of the previous page through practice of the
Set Constraints procedure by using the Scheduling Theme.
Scheduling Theme
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
Module Review
After answering the questions, allow students to openly discuss any of the
topics covered.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 vii
Lab Setup
No lab setup requirements affect replication or customization.
Lab Results
No configuration changes on student computers affect replication or
customization.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 1
Module Overview
! Domain of a Population
! What Are Value Constraints?
! How Value Constraints Are Represented
! How to Implement Value Constraints
! Practice: Implementing Value ConstraintsScheduling
Theme
Domain of a Population
Domain Population
A A
B
B C Not in the
Z Domain
C
Figure 7.1 A
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction Fact types in an Object Role Modeling (ORM) model represent
relationships between populations. Constraints are used to limit those
populations. In ORM, there are several methods of limiting the domain of
an object type.
All allowable values The domain of a population represents all of the possible values that could
exist in the population. It is not necessary that each member of the domain
be used. It is only important that each member could be used.
For example, an object could be constrained to allow only a number
between 1 and 5, or to allow only the names of the days of the week.
Values in domain are The domain of a population represents the unique values that could exist,
unique without duplicates. This list can contain one or many values. If a value is
not on the list, then it cannot appear in the physical database.
For example, a domain that contained the names of days of the week would
not list Wednesday twice.
Population is not always In contrast to the domain of a population, the actual population consists of
unique zero or more instances of each domain value.
For example, a populations domain may be limited only to the days of the
week, but the actual population may include multiple entries for any given
day.
4 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
! Definition
Value constraints limit the population of an object type to a
specific domain of allowable values
! Characteristics
" Global effect on an object types roles
" Defined by enumerated list of values
" Limit the effect on the Universe of Discourse
! FORML expression
Person(Name) is an entity object type.
Every Person is identified by one
distinct Name.
The possible values of 'Name' are:
'Jeff', 'Maria', 'Pierre'.
! Graphically
{ 'Jeff', Value
'Maria', Constraint
'Pierre' }
Person
Car
(Name)
drives
Figure 7.2
Select
Select the
theobject
objecttype
type
Specify
Specifythe
thedomain
domainof
of values
valuesor
ornumeric
numericranges
ranges
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod07 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 9
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod07\Answer folder.
10 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
Lesson Review
Objectives
Objectives
Implement
Implement value
value constraints
constraints
Describe
Describeand
and identify
identify population
population domains
domains
Describe
Describevalue
value constraints
constraintsand
andtheir
theiruses
uses
! Set equality
Set 1 Set 2
Figure 7.3
A B C A B C
! Subset
Set 1 Set 3
A B C A B
Figure 7.4
! Set exclusion
Set 3 Set 4
Figure 7.5
A B C
{A,B,C} {A,B,C}
{apple, orange, pear, banana} {apple, orange, pear, banana}
Subset The instances shown in Figure 7.4 illustrate that set 3 is a subset of the
population of set 1. No instance can exist in set 3 if it does not exist in set 1.
Table 7.2
Set 1 Set 3
{A,B,C} {A,B}
{apple, orange, pear, banana} {apple, pear }
Set Exclusion The instances shown in Figure 7.5 illustrate that set 4 contains no instances that
are in set 3. No overlap between the populations occurs.
Table 7.3
Set 3 Set 4
{A,B } {C}
{apple, pear} {orange, banana}
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 13
! Definition
Set constraints restrict two populations in relation to each
other
! Characteristics
" External
" Constrain two roles or tuples
" Transfer the impact of constraints
Caution Although you can create an internal set constraint on the roles in a
single fact type, typically it is not meaningful.
Subset
If Employee e works as Constraint
some SalesManager then
Employee e works as some Salesperson
Salesperson. works as
Figure 7.6
1 22 3
Identify
Identifyand
and select
selectthe
thefact
facttypes
types
Select
Selectthe
thetype
typeof
ofset
set constraint
constraint
Designate
Designatethe
the roles
rolesin
inthe
theset
setconstraint
constraint
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
Note The roles designated for the set constraint must represent the same
object type.
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod07 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 19
Which fact type represents the set of tuples that indicates the set of persons
who approved the use of venues for meetings?
Person approves use of Venue for Meeting.
____________________________________________________________
____________________________________________________________
Based on the mandatory role constraints on the fact types, which fact type
constrains the domain of Person and Venue instances that can participate in
others?
The domain of the Person owns Venue fact type constrains the domain
of the Person approves use of Venue for Meeting fact type.
____________________________________________________________
____________________________________________________________
2. On the drawing surface, click the predicate shape for the Person Owns
Venue fact type, SHIFT+right-click the predicate shape for the Person
approves use of Venue for Meeting fact type, and then click Add
Constraint.
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod07\Answer folder.
20 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
Lesson Review
Objectives
Objectives
Implement
Implement set
set constraints
constraints
Describe
Describeand
and identity
identity set
setcomparisons
comparisons
Describe
Describeand
and identify
identify set
setequality
equality constraints
constraints
and
and their
theiruses
uses
Describe
Describeand
and identify
identify subset
subset constraints
constraintsand
and
their
theiruses
uses
Describe
Describeand
and identify
identify set
setexclusion
exclusion constraints
constraints
and
and their
theiruses
uses
! Subsets of a population
! Subsets have distinctive
A
characteristics
" Specialized relationships B C
" Specialized constraints
" Start from primitive object
types D E
! Top-down process
" Arrows point toward node
that was specialized F G
Figure 7.7
Top-down process The process of specialization of object types is a top-down process. You start
with the population of the most abstract object type, and then you refine it,
drilling down into less and less abstract object types.
24 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
! Supersets of a population
! Supersets have overlapping
G
characteristics
" Shared relationships E F
" Shared constraints
" End up with a shared
primitive object type C D
! Bottom-up process
" Arrows point toward more
generic nodes A B
Figure 7.8
Bottom-up process The process of generalizing object types is a bottom-up process. You start with
specialized populations, and then you progress to more and more general-
purpose object types.
26 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
! Definition
An entity subtype is an object type that is contained in another
object type
! Characteristics
" Identified by the primary supertypes reference scheme
" Populations may overlap through implied set constraint
" Reuse through inheritance
" Subtypes are transitively related
" Cumulative relationships and constraints
" Based on primitive entity types
Salesperson is a subtype of
Employee / Employee is a Accountant Salesperson
supertype of Salesperson.
Entity subtype shapes Entity subtypes are indicated by an arrow-tipped line that connects the object
type that is a subtype with the object type that is the supertype. The arrow
always points to the supertype.
A solid line indicates the primary subtype and primary path of inheritance for
identification purposes. A dotted line indicates a secondary subtype in the case
of multiple inheritances, differing only in that it is not used for identification.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 29
Do
Do not
not create
create aa subtype
subtype unless
unless there
there is
is aa specific
specific role
role for
for itit
Explicitly
Explicitly constrain
constrain subtypes
subtypes to
to enforce
enforce different
different uses
uses
Create
Create aa chain
chain of
of subtypes
subtypes relating
relating back
back to
to aa primitive
primitive entity
entity type
type
Avoid
Avoid assigning
assigning aa subtype
subtype its
its own
own reference
reference scheme
scheme
Identify
Identifyentity
entity supertypes
supertypesand
andcreate
create entity
entitysubtype
subtype
objects
objects
Create
Create subtype
subtype relationships
relationships
Create
Create entity
entitysubtype
subtyperelated
relatedfact
fact types
types
Enforce
Enforcesubtypes
subtypeswith
withvalue
valueand
and set
set constraints
constraints
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod07 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
2. Create the new entity subtypes called Location and Online, and then drag
them onto the drawing surface.
5. Repeat steps 3 and 4 by using the information in Table 7.5, and then click
Cancel.
Table 7.5
Constraint Constraint
Object name Relationship Object name question #1 question #2
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod07\Answer folder.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 35
Lesson Review
Objectives
Objectives
Implement
Implement entity
entity subtypes
subtypes
Describe
Describethe
the specialization
specialization of
of object
object types
types
Describe
Describethe
the generalization
generalizationof
ofobject
object types
types
Describe
Describeand
and identify
identify subtype
subtyperelationships
relationshipsand
and
their
theiruses
uses
3. What is the purpose of using set and value constraints in conjunction with
entity subtypes?
To ensure the purposeful separation of a supertypes population into
one or more subtype populations.
36 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
Domain of a population Remember that the domain of a population is the allowable values of an object
type or role. You use value and set constraints to limit the allowable members
of a population.
Comparing and Remember that the instances in a population make up a set. You control which
contrasting set populations are related through the use of fact types, and you can control the
populations domains of roles in those fact types by using set constraints.
Specialization of object Remember that you may need to model specialized relationships or constrain
types specific populations of an object type. You use subset constraints to isolate a
subset of an object types population so that you can create specific
relationships and constraints on that subset.
38 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
Implement
Implemententity
entitysubtypes
subtypes
Implement
Implementvalue
value constraints
constraints
Implement
Implementset
set constraints
constraints
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
London
UK11 (LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
VE59
Starting US68
VE56
Dakar
(DKR)
Model Caracas
(CCS)
Practice You will use the files in the C:\MOC\2090\Practices\Mod07 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
5. In the WestboundFlight has odd Number fact type, specify the Number is
always odd derived but not stored derivation rule.
6. In the EastboundFlight has odd Number fact type, specify the Number is
always even derived but not stored derivation rule.
6. On the drawing surface, select the shapes for the Status, Number, and
Country object types.
7. Use the Verbalizer to verify that the following text is displayed somewhere
in the Verbalizer window:
Status is a value object type.
The possible values of 'Status' are: 'On Time',
'Delayed', 'Arriving', 'Boarding', 'Canceled', 'Will
Board'.
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod07\Answer folder.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 43
London
UK11
(LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO)
Atlanta 3 US62
VE56
(ATL)
VE59
US68 Dakar
Solution VE56
(DKR)
Model Caracas
(CCS)
Implement value Value constraints were applied to the Status, Country, and Number object
constraints types that limited the domain of allowable values for each object type to those
noted in the scenario requirements.
The value constraints have the effect of limiting the UoD by restricting the
instances of each fact type that may exist in the data model. All status codes are
standardized. The model tracks only flights that originate in a known set of
countries. The numeric component used to identify a flight is limited to
numbers between 1 and 99. All other instances of Flight that are not related to
domains specified by the value constraints are not in the scope of the UoD.
The mandatory role constraint on the Flight roles of the Flight has Status,
Flight originates in Country, and Flight has Number fact types force all
instances of Flight to be affected by the value constraints.
Validate the ORM model The need for the entity subtypes was indicated in the scenario requirements that
and your intent called for special relationships for each subtype, and a set exclusion constraint
between roles in those special relationships, as indicated by:
! You can categorize all flights as either eastbound or westbound.
! The number is always even for eastbound flights and always odd for
westbound flights.
The scenario requirements that called for value constraints were indicated by
the scenario requirements:
! A given flight is identified by concatenating the two-letter code for the
country it originated in with a number from 1 to 99.
! All flights have a status, limited to On Time, Delayed, Arriving,
Boarding, Canceled, or Will Depart.
! You will only model information for flights that originated in the United
States, United Kingdom, Italy, Spain, Senegal, and Venezuela. The two
letter codes for those countries are US, UK, IT, ES, SN, and VE,
respectively.
You then used the text output from the Verbalizer to validate that the
requirements of the scenario were met. You should also reevaluate any example
data that you entered or possibly deleted while applying CSDP step 6.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 45
Lesson Review
Objectives
Objectives
Apply
Apply CSDP
CSDP step
step 66
Implement
Implementvalue
valueconstraints
constraints
Implement
Implementset
set constraints
constraints
Implement
Implemententity
entitysubtypes
subtypes
2. In the procedures for implementing CSDP step 6, why are entity subtypes
implemented before value and set constraints?
Set and value constraints help to define the population of each subtype.
46 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
Module Review
For more information The procedures in this lab are a series of directives. If needed, refer to the
practices in the module for detailed implementation instructions. Additionally,
use the appendixes in this course for a symbol guide and a glossary of terms.
Scenario This lab uses the Academic Theme that you are already familiar with. Refer to
the scenario sections of each exercise for more information. An ORM source
model is provided that represents limited information about the academic
faculty of a college, as well as departmental budget information.
You will use the files in the C:\MOC\2090\Labfiles\Lab07A folder to complete
this lab. Solution files for each exercise are in the Answer subdirectory of that
folder.
Estimated time to
complete this lab:
30 minutes
48 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 49
Exercise 1
Implementing Entity Subtypes
In this exercise, you will identify a conceptual partitioning scheme by using the
Academic Theme.
Scenario For the purposes of this exercise, the UoD is limited to the information in this
scenario.
You are tasked with implementing entity subtypes in an ORM source model. In
this exercise, do not change any of the fact types beyond adding entity subtypes
and related fact types.
! Each academic works for at most one department.
! Some academics can be categorized as professors, some as teachers, and
some as both. If a professor also teaches, his or her teaching duties are
secondary to professorial duties.
! Each teacher is audited by at most one other teacher.
! It is possible that some professors who teach serve on more than one
committee.
! For each department, at most one professor heads the department. Each
professor heads at most one department.
Tasks
! Identify entity supertypes and create entity subtype objects
1. Open and review the ApplyCSDP6_Academic.vsd ORM source model.
According to the scenario, which primitive entity type has population
subsets that participate in different relationships?
Academic.
____________________________________________________________
____________________________________________________________
What new subtype entities are called for by the scenario, and what are their
supertypes?
Professor and Teacher are subtypes of the Academic supertype.
TeachingProfessor is a subtype with two supertypes, Professor and
Teacher.
____________________________________________________________
____________________________________________________________
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod07A\Answer folder.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 51
Exercise 2
Implementing Set Constraints
In this exercise, you will check the arity of each fact type for sufficient cause in
an ORM model to split the fact type into new elementary fact types by using the
Academic Theme.
Scenario For the purposes of this exercise, the UoD is limited to the information in this
scenario.
You are tasked with implementing set constraints in the resultant ORM source
model from the previous exercise. Entity subtype relationships have already
been created in the model. Do not change any of the fact types beyond adding
set constraints.
Each department is headed by a professor who works for that same department.
You will use the model that you modified in the previous exercise to complete
this practice. Alternatively, use the ImplSubtype_Academic_Answer.vsd ORM
source model in the C:\MOC\2090\Labfiles\Mod07A\Answer folder.
Tasks
! Implement set constraints
1. Examine the Academic works for Department and the Professor heads
Department fact types.
Which role combination represents the largest population domain?
The {Academic, Department} role combination has at least as large a
population domain as the {Professor, Department} role combination.
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod07A\Answer folder.
Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6 53
Exercise 3
Implementing Value Constraints
In this exercise, you will reformulate a fact type that needs to be split in an
ORM model into new elementary fact types by using the Academic Theme.
Scenario For the purposes of this exercise, the UoD is limited to the information in this
scenario.
You are tasked with implementing set constraints in the resultant ORM source
model from the previous exercise. Entity subtype relationships and set
constraints have already been created in the model. Do not change any of the
fact types beyond adding value constraints.
! Each time that an academic teaches a subject, he or she may receive a rating
on the teaching on a scale of 1 to 7.
! The only allowable rank codes are P, SL, and L.
! The only allowable access level codes are Full and Local.
You will use the model that you modified in the previous exercise to complete
this practice. Alternatively, use the ImplSet_Academic_Answer.vsd ORM
source model in the C:\MOC\2090\Labfiles\Mod07A\Answer folder.
Tasks
! Implement value constraints
1. Examine the model and the scenario requirements.
Which object types have their domains limited to certain values?
Rating, Rank, and AccessLevel.
____________________________________________________________
____________________________________________________________
2. Create value constraints on object types that restrict their domains to a list of
values, as indicated by the scenario requirements.
3. Create value constraints on object types that restrict their domains to a range
of numeric values, as indicated by the scenario requirements.
54 Module 7: Adding Value and Set Constraints, and Creating Entity SubtypesCSDP Step 6
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod07A\Answer folder.
Module 8: Adding
Frequency and Ring
ConstraintsCSDP
Contents
Step 7
Module Overview 1
Lesson: Implementing Frequency
Constraints 2
Lesson: Implementing Ring Constraints 12
Lesson: Applying CSDP Step 7 33
Module Review 42
Lab A: Implementing Frequency and
Ring Constraints 44
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 iii
Instructor Notes
This module teaches students the Conceptual Schema Design Procedure
(CSDP) step 7. This step covers adding frequency and ring constraints.
Presentation: This module provides students with the necessary knowledge and skills to
60 minutes complete CSDP step 7.
Lab: After completing this module, students will be able to:
30 minutes
! Complete CSDP step 7.
Implement frequency constraints.
Implement ring constraints.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_08.ppt
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering questions, allow students to openly discuss any
of the topics covered.
What Are Ring This topic page defines and provides the characteristics of ring constraints.
Constraints? Make sure that you cover the high-level descriptions and characteristics, but do
not try to focus on each ring constraint, because they are each covered in detail
on the following pages.
How Ring Constraints This topic page covers how ring constraints are visually indicated on an ORM
Are Symbolized diagram. Point out that the shapes for different types of ring constraints differ
only in the annotation above the ring constraint shape, and that the shape for
ring constraints is identical to that of frequency constraints, without the
annotation.
Irreflexive Ring This topic page defines and describes irreflexive ring constraints. Additionally,
Constraints this page illustrates the constraint with a mathematical equation and a non-
example. Note that iff means if and only if, xRx means the set of X is
related to the set of X, and ~ means not.
Symmetric Ring This topic page defines and describes symmetric ring constraints. Additionally,
Constraints this page illustrates the constraint with a mathematical equation and a non-
example. Note that right arrow means implies that.
Asymmetric Ring This topic page defines and describes asymmetric ring constraints.
Constraints Additionally, this page illustrates the constraint with a mathematical equation
and a non-example.
Antisymmetric Ring This topic page defines and describes antisymmetric ring constraints.
Constraints Additionally, this page illustrates the constraint with a mathematical equation
and a non-example.
Intransitive Ring This topic page defines and describes intransitive ring constraints. Additionally,
Constraints this page illustrates the constraint with a mathematical equation and a non-
example.
Acyclic Ring Constraints This topic page defines and describes acyclic ring constraints. Additionally, this
page illustrates the constraint with a mathematical equation and a non-example.
Valid Ring Constraint Be careful not to place too great an emphasis on this topic. Tell students that
Combinations memorization of this diagram is unimportant; instead, they should be familiar
with it as it relates to the user interface (UI) of Microsoft Visio Enterprise
Architect edition. Students should understand that they will implement ring
constraints by choosing the appropriate area of the diagram in the UI.
How to Implement Ring This page instructs students on the high-level steps of how to implement ring
Constraints constraints.
Practice: Implementing This page reinforces the elements of the previous page through practice of the
Ring Constraints procedure by using the Scheduling Theme.
Scheduling Theme
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering questions, allow students to openly discuss any
of the topics covered.
vi Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering questions, allow students to discuss openly any
of the topics covered.
Module Review
After answering the questions, allow students to discuss openly any of the
topics covered.
Lab Setup
No lab setup requirements affect replication or customization.
Lab Results
No configuration changes on student computers affect replication or
customization.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 1
Module Overview
Domain Population
A A
A
B C
C
C
Figure 8.1 A
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction You can control domain values, as well as how often they appear in your
model, by using frequency constraints.
Each instance must Remember that instances must have a value listed in the domain of a
have an allowable value population. The instances are unique in the domain of allowable values. You set
from the population these values in CSDP step 6 by using value constraints.
domain
Multiple instances could Although the list of allowable values is unique, it is possible that you could
have the same value assign more than one instance the same value in the population domain.
For example, notice in Figure 8.1 that A and C appear only once in the domain
of allowable values. However, three instances in the population have the
domain value of A, and two have the domain value of C. This is perfectly
acceptable because the instances are reusing the same value, not re-creating it.
4 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
! Definition
Frequency constraints restrict the number of instances in a
population that may share the same domain value
! Characteristics
" Specify the cardinality of a role
" Apply to a role or tuple
" Control the size of the population of a fact type
! Special types of frequency constraints
" Mandatory role
" Uniqueness
Special types of Mandatory role and uniqueness constraints are special types of frequency
frequency constraints constraints.
! Mandatory role
Remember that a mandatory role constraint forces every instance in a
population to participate in a role. This effectively creates a frequency
constraint on that role with a range of one or more occurrences.
! Uniqueness
Remember that a uniqueness constraint prevents duplicate instances in a
role. This effectively creates a frequency constraint on that role, limiting
occurrences of any instance to exactly one.
6 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
! FORML expression
Each Person occurs exactly 2 times or not at all.
2 3..4
Person Location
...drives...to...
Select
Select the
thefact
fact type
type
Select
Select the
therole
role or
orroles
roles
Designate
Designatethe
thenumber
numberof
ofoccurrences
occurrencesallowed
allowed
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod08 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
2. On the drawing surface, right-click the predicate shape for the Meeting is a
reoccurrence of Meeting fact type, and then click Add Constraints.
____________________________________________________________
____________________________________________________________
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod08\Answer folder.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 11
Lesson Review
Objectives
Objectives
Implement
Implement frequency
frequency constraints
constraints
Describe
Describe and
and identify
identify reoccurring
reoccurring domain
domain
values
values
Describe
Describe frequency
frequency constraints
constraints and
and their
their uses
uses
! Definition
Ring constraints control the population of an object types
roles when the object type has two roles in a fact type
! Characteristics
" Common object type
" Recursively related role populations
" Strong constraint
" Six different types
Ring
Ring Ring
Ring
Constraint
Constraint Constraint
Constraint
Ring
Ring
Constraint
Constraint
Figure 8.5
11 2 33
Irreflexive ir
Symmetric sym
Asymmetric as
Antisymmetric ans
Intransitive it
Acyclic ac
16 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
Examples The diagrams in Figures 8.3, 8.4, and 8.5 are all intentionally generic so that
they do not imply a particular type of ring constraint. Figure 8.3 shows a ring
constraint over a simple binary fact type. Figure 8.4 shows a ring constraint
over two roles in a ternary fact type. Figure 8.5 shows a ring constraint over the
roles in a binary fact type whose objects are both subtypes of common
supertypes.
Caution The shape for a ring constraint is similar to the shape for a frequency
constraint that spans two roles. Graphically, they differ only in how they are
annotated.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 17
! Purpose No
Noinstance
instanceisisrelated
relatedto
toitself.
itself.
! Non-example data
xx yy
AA Figure 8.XBB Figure 8.6
BB DD
CC BB ! Mathematical expression
DD EE R is irreflexive iff
Constraint
Constraint
Violation!
Violation! AA AA for all x
Table 8.3 ~ xRx
11 2 33
A B
B D
C B
D E
A A
FORML expression The FORML expression for an irreflexive (ir) ring constraint is:
No Object is related to itself.
18 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
! Purpose Musthave
Must
Must havemirror
have mirrorimages
mirror image
images
! Non-example data
xx yy
AA Figure 8.XAA Figure 8.7
AA BB
BB BB ! Mathematical expression
BB AA R is symmetric iff
Constraint
Constraint
Violation!
Violation! AA CC for all x, y
Table 8.4 xRy ! yRx
11 2 33
A A
A B
B B
B A
A C
FORML expression The FORML expression for a symmetric (sym) ring constraint is:
If Object o1 is related to Object o2
then Object o2 is related to Object o1.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 19
! Purpose No
Noopposites
opposites
! Non-example data
xx yy
AA Figure 8.XBB Figure 8.8
BB CC
AA AA ! Mathematical expression
CC DD R is asymmetric iff
Constraint
Constraint
Violation!
Violation! BB AA for all x, y
Table 8.5 xRy ! ~yRx
11 2 33
A B
B C
A A
C D
B A
20 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
FORML expression The FORML expression for an asymmetric (as) ring constraint is:
If Object o1 is related to Object o2
then it cannot be that
Object o2 is related to Object o1.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 21
! Purpose No
Noopposites
oppositesor
ormirror
mirrorimages
images
! Non-example data
xx yy
AA Figure 8.XBB Figure 8.9
BB CC
Constraint
Constraint
Violation!
Violation! AA AA ! Mathematical expression
CC DD R is antisymmetric iff
Constraint
Constraint
Violation!
Violation! BB AA for all x, y
Table 8.6 x =/ y & xRy ! ~yRx
11 2 33
A B
B C
A A
C D
B A
22 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
FORML expression The FORML expression for an antisymmetric (ans) ring constraint is:
If Object o1 is related to Object o2
and o1 is not the same Object as o2, then it cannot be that
Object o2 is related to Object o1.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 23
! Purpose You
Youcannot
cannotskip
skipaageneration
generation
! Non-example data
xx yy
AA Figure 8.XBB Figure 8.10
BB CC
CC DD ! Mathematical expression
DD EE R is intransitive iff
Constraint
Constraint
Violation!
Violation! AA EE for all x, y, z
Table 8.7 xRy & yRz ! ~xRz
11 2 33
A B
B C
C D
D E
A E
24 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
FORML expression The FORML expression for an intransitive (it) ring constraint is:
If Object o1 is related to Object o2
and Object o2 is related to Object o3
then it cannot be that
Object o1 is related to Object o3.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 25
! Purpose No
Noancestor
ancestorisisaadescendant
descendant
! Non-example data
xx yy
AA Figure 8.XBB Figure 8.11
BB DD
CC EE ! Mathematical expression
DD FF R is acyclic iff
Constraint
Constraint
Violation!
Violation! FF AA for all x, y, z
Table 8.8 xRy & yRz ! ~zRx
11 2 33
A B
B D
C E
D F
F A
26 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
FORML expression The FORML expression for an acyclic (ac) ring constraint is:
A Object cannot cycle back to itself through one or more
applications of the relationship:
Object is related to Object.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 27
o o o
ans ir sym
oas
oit
o
ac
Figure 8.12
Table 8.9
Combination Abbreviation Combined effect
Tip To better understand Figure 8.12, picture it as a dart board. When a dart is
thrown, the circle or circles that it lands in define its properties. This may be
only one constraint, a combination, or none at all.
28 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
Identify
Identifyaafact
fact type
typewith
withthe
thesame
same object
objecttype
typein
in two
two
roles
roles
Select
Select constraint
constraint role
roleorder
order
Select
Select aavalid
valid combination
combinationof
of ring
ring constraint
constraint types
types
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Practice You will use the files in the C:\MOC\2090\Practices\Mod08 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
! Identify a fact type with the same object type in two roles
1. Open and review the ImplRing_Scheduling.vsd ORM source model.
According to the scenario, on which fact type should you place a ring
constraint?
Meeting is a reoccurrence of Meeting.
____________________________________________________________
____________________________________________________________
____________________________________________________________
Which type of ring constraint prevents a descendent from having more than
one ancestor?
Intransitive.
____________________________________________________________
____________________________________________________________
2. In the Ring Constraint Properties window, in the Ring Type box, select
Acyclic + Intransitive, and then click OK twice.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 31
3. On the Database menu, click Model Error Check, and then examine the
contents of the Output window.
What ring constraint validation error do you receive?
Error C2042: RC:it,ac (Meeting is a reoccurrence of Meeting) :
Intransitive constraint is implied by a simple uniqueness constraint on
the predicate.
____________________________________________________________
____________________________________________________________
4. On the drawing surface, double-click the abbreviation for the ring constraint
on the Meeting is a reoccurrence of Meeting fact type.
5. In the Database Properties window, in the Ring Type list, select Acylic.
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod08\Answer folder.
32 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
Lesson Review
Objectives
Objectives
Implement
Implement ring
ring constraints
constraints
Describe
Describeand
and identify
identify intra-population
intra-population relationships
relationships
Describe
Describering
ring constraints
constraints and
and their
their uses
uses
Tip You can use functionality on the Constraints tab of the Fact Editor to
simultaneously create mandatory role constraints, uniqueness constraints, and
frequency constraints.
Implement
Implementfrequency
frequencyconstraints
constraints
Implement
Implementring
ring constraints
constraints
Validate
Validate the
theORM
ORM model
modeland
and your
yourintent
intent
Consider
Consideriteratively
iterativelyapplying
applying CSDP
CSDPsteps
steps1-7
1-7
! Purpose
! Scenario
! Practice
London
UK11
(LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO
Atlanta 3 US62 )
VE56
Starting (ATL)
US6
VE59
Dakar
VE56
Model
8 (DKR)
Caracas
(CCS)
Practice You will use the files in the C:\MOC\2090\Practices\Mod08 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
____________________________________________________________
What are the role names for each of the Airport roles?
Outbound Airport and Inbound Airport
____________________________________________________________
____________________________________________________________
What is the effect of the uniqueness constraint over the first two roles?
If a flight has multiple segments, it can take off from a given airport
only once.
____________________________________________________________
____________________________________________________________
What is the effect of the uniqueness constraint over the first and third roles?
If a flight has multiple segments, it can land at a given airport only
once.
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________________________________
If needed, review the solution files for this practice located in the
C:\MOC\2090\Practices\Mod08\Answer folder.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 39
London
UK11
(LHR)
US72
IT37
New York
Madrid Rome
(JFK)
ES2 (MAD) (FCO
Atlanta 3 US62 )
VE56
(ATL)
Solution US6
8
VE59
VE56
Dakar
(DKR)
Model Caracas
(CCS)
Implement ring You should have created an irreflexive ring constraint across the Airport roles
constraints in the Flight travels between Airport to Airport fact type that prevents the
same instance of Airport from appearing in both Airport roles at the same
time.
With respect to the scenario, the irreflexive ring constraint prevents a flight
from taking off and landing at the same airport on the same segment.
When combined with the two uniqueness constraints on the fact type, the
irreflexive ring constraint effectively prevents a flight from revisiting an airport
to which it has already been on any segment.
Validate the ORM model The need for the frequency constraints was indicated in the scenario
and your intent requirements that called for limiting the number of times a domain value could
be used, as indicated by:
! A segment is the travel path between an origination airport and a destination
airport. A given flight may not have more than two segments.
! Multiple flights may travel the same segments, but for a given airport, a
maximum of five flights that use the same segment are allowed.
The scenario requirements that called for a ring constraint was indicated by the
scenario requirement:
! A flight may not take off from and land at the same airport.
You then used the text output from the Verbalizer to validate that the
requirements of the scenario were met.
Consider iteratively The CSDP should be applied iteratively to discover and refine an effective
applying CSDP steps 1-7 ORM model until you are satisfied that the model appropriately captures all
aspects of the UoD.
Lesson Review
Objectives
Objectives
Apply
Apply CSDP
CSDP step
step 77
Implement
Implementfrequency
frequency constraints
constraints
Implement
Implementring
ring constraints
constraints
2. At what point can you be sure you have an accurate and adequate
conceptual model?
The application of each of the CSDP steps frequently entails changes to
the model as you go. You should always consider revisiting all steps
iteratively to refine and improve the model until you are sure that you
have created an accurate conceptual model of the UoD.
42 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
Module Review
4. What three relationships among groups deal primarily with ring constraints?
Circularly related groups, hierarchically related groups, and set
relationships between groups.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 43
For more information The procedures in this lab are a series of directives. If needed, refer to the
practices in the module for detailed implementation instructions. Additionally,
use the appendixes in this course for a symbol guide and a glossary of terms.
Scenario This lab uses the Academic Theme that you are already familiar with. Refer to
the scenario sections of each exercise for more information. An ORM source
model is provided that represents limited information about the academic
faculty of a college and departmental budget information.
You will use the files in the C:\MOC\2090\Labfiles\Lab08A folder to complete
this lab. Solution files for each exercise are in the Answer subdirectory of that
folder.
Estimated time to
complete this lab:
30 minutes
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 45
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
46 Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7
Exercise 1
Implementing Frequency Constraints
In this exercise, you will implement frequency constraints by using the
Academic Theme.
Scenario For the purposes of this exercise, the UoD is limited to the information in this
scenario.
You are tasked with implementing frequency constraints in an ORM source
model. In this exercise, do not change any of the fact types other than adding
the frequency constraints.
! Every teacher is audited two or three times.
! A given professor that teaches is not allowed to serve on more than four
committees.
Tasks
! Implement frequency constraints
1. Open and review the ApplyCSDP7_Academic.vsd ORM source model.
2. Create a frequency constraint over the appropriate roles, as indicated by the
scenario.
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod08A\Answer folder.
Module 8: Adding Frequency and Ring ConstraintsCSDP Step 7 47
Exercise 2
Implementing Ring Constraints
In this exercise, you will implement ring constraints in an ORM model by using
the Academic Theme.
Scenario For the purposes of this exercise, the UoD is limited to the information in this
scenario.
You are tasked with implementing a ring constraint in the resultant ORM
source model from the previous exercise. Frequency constraints have already
been created in the model. Do not change any of the fact types beyond adding
ring constraints.
! Teachers cannot audit themselves.
! Teachers cannot audit teachers who have already audited them.
You will use the model that you modified in the previous exercise to complete
this practice. Alternatively, use the ImplFreq_Academic_Answer.vsd ORM
source model in the C:\MOC\2090\Labfiles\Mod08A\Answer folder.
Tasks
! Implement ring constraints
1. Examine the Teacher is audited by Teacher fact type.
2. Create a ring constraint over the appropriate roles, as indicated by the
scenario.
What type of ring constraint should you have created?
Antisymmetric, which prevents mirror images and opposites.
____________________________________________________________
____________________________________________________________
____________________________________________________________
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Mod08A\Answer folder.
THIS PAGE INTENTIONALLY LEFT BLANK
Module 9: Generating a
Relational Logical
Model
Contents
Module Overview 1
Lesson: Understanding Relational Logical
Models 2
Lesson: Understanding Normalization 10
Lesson: Generating a Relational Logical
Model 22
Module Review 30
Lab A: Generating a Relational Logical
Model 31
Course Evaluation 34
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 9: Generating a Relational Logical Model iii
Instructor Notes
Presentation: This module provides students with the necessary knowledge and skills to
45 minutes create relational logical models.
Lab: After completing this module, students will be able to:
30 minutes
! Generate a relational logical model.
Describe a relational logical model.
Describe normalization.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_09.ppt
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
What Is First Normal This topic page defines and describes First Normal Form. The example consists
Form? of an excerpt for a fictitious order entry system. During the discussion you may
use the following nonexamples to further explain First Normal Form.
If the Customer table contained a column called ContactInformation that
holds the customer's first name, last name, and phone number, this would
violate the one type of information and single value clauses of 1NF.
Additionally, if the Customer table contained a single column called Orders
that contained the order ID number for each order that a customer places,
delineated in some fashion, this would be a multi-valued column and would
violate the single value clause of 1NF.
Finally, if the table contained multiple columns for order ID numbers, such as
Order1, Order2, and Order3, each one containing the OrderID key for each
order placed, that would violate the repeating groups clause of 1NF.
What Is Second Normal This topic page defines and describes Second Normal Form. The order entry
Form? system example now contains an Order and an OrderDetail table, similar to
the tables in Northwind.
What Is Third Normal This topic page defines and describes Third Normal Form. It continues using
Form? the order entry example and adds a Sales table.
Benefits of This topic page describes the major benefits of normalization. Make sure that
Normalization students understand that this is not an all inclusive list, just a few of the more
important benefits.
What Is This is background material only; students will not perform denormalization in
Denormalization? this course.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
vi Module 9: Generating a Relational Logical Model
Important
! When a source file is added to a project, the project remembers the directory
location of that source file. The project will then always verify that the
source file exists in this directory. Because of this, the source files cannot be
moved after they have been added to a project. There is no such restriction
on the project file, however.
! Because Visio requires the .vsd files to be writable in many of the practices
and labs, students will be able to save updated versions of the starting and
answer files back to their original directories of C:\Moc\2090\.... After
students overwrite a course-supplied .vsd file, in order to return it to its
original state, they must copy it from another source, or restore it by running
the Allfiles.exe application found on the Student Materials compact disc.
! Running Allfiles.exe will overwrite all the course-supplied files. For that
reason, you may advise students to make a copy of the C:\Moc\2090\...
directory tree to save the original files to another location on their
computers hard disk.
Multimedia This topic page briefly describes and introduces the multimedia visual aid. This
visual aid covers the way that Visio maps ORM constructs into ER constructs.
Make sure that students understand that there is no one-to-one correlation
between the objects in the ORM model and objects in the relational logical
model.
What Is a Project? This topic page defines and describes projects and their uses in Visio and how
they are used in this course to generate relational logical models. It covers the
components, source models, and external objects. External objects are described
but not demonstrated. If you want, you may demonstrate their use for students
who need help understanding.
How to Generate a This topic page instructs students on how to create a project, how to generate a
Relational Logical Model relational logical model, and, finally, how to draw the logical model diagram.
from a Conceptual Make sure that students understand that, just like an ORM model, a relational
Model logical model exists, regardless of whether it is visible on the drawing surface.
The diagram is only the graphical representation of the model.
Practice: Generating a This page reinforces the elements of the previous page through practice of the
Relational Logical Model procedure by using the Scheduling Theme. There is no link on this slide to the
from a Conceptual solution project file. Open the answer file from the course files folder.
ModelScheduling
Theme The starting file for this practice is the ORM source model. Students will create
the project file and add the ORM source model to it during the practice. The
answer file for this practice is the solution project file. It will link to the starting
ORM source model when opened.
Module 9: Generating a Relational Logical Model vii
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
Module Review
After answering the questions, allow students to openly discuss any of the
topics covered.
Lab Setup
There are no lab setup requirements that affect replication or customization.
Lab Results
There are no configuration changes on student computers that affect replication
or customization.
Module 9: Generating a Relational Logical Model 1
Module Overview
! Definition
The relational logical model is a representation of the
conceptual business data requirements modeled using
tables, columns, and relationships
! Components
" Tables
" Columns
" Primary keys
" Relationships
LastName U1 LastName
FirstName U1 FirstName
BirthDate U1 BirthDate
Address Address
Figure 9.2 PhoneNumber Figure 9.4 PhoneNumber
Table
Tables represent the existence of things of interest.
Tables are symbolized by rectangular grid with solid
borders. The table name appears in the shaded heading
region.
Columns
The divisions of data within a table. Columns are either
part of the primary key or describe the real-world object
instances contained in the table.
Non-primary key columns are listed in the second row.
Module 9: Generating a Relational Logical Model 5
Primary key
A primary key identifies a row of data. A primary key is,
by definition, unique.
The columns of a primary key are located in the first row
of a table shape and are identified by the letters PK in the
cell to the left. Also, the primary key is underlined.
Uniqueness constraint
A uniqueness constraint guarantees that each value, or
combination of values, will appear only once in a table.
Uniqueness constraints are symbolized by the letters U(n)
where n is the ordinal of the uniqueness constraint in the
entity. Columns spanned by a uniqueness constraint that
are not part of the primary key are considered alternate
keys.
Required columns are bold.
6 Module 9: Generating a Relational Logical Model
! Definition
Relationships are associations between tables
! Characteristics
" Shared columns
" Foreign keys
" Relationship cardinality
Examples
One to zero or more One to zero or more
Figure 9.10
Tip You have the choice of displaying the numeric relationship cardinality
with the default relationship arrows, or displaying the Crows feet notation
without the numeric cardinality. Switch between the two notations to see the
numeric cardinality when you have range of value constraints in the ORM
model.
8 Module 9: Generating a Relational Logical Model
Zero
It is valid for the side of the relationship on which this symbol
is found to have no participating rows. That side of the
relationship is optional.
One
The side of the relationship on which this is found may have
one participating row. Two vertical lines mean that you must
have exactly one, usually stated as one.
Many
The side of the relationship on which this is found may have
more than one participating row. The many symbol is found
only on the child side of the relationship.
Identifying and non- In addition to the Crows feet notation, the relational logical diagram uses either
identifying relationships dashed or solid lines to indicate whether the foreign key in the child table also
becomes its primary key. A dashed line, the most common type, means that the
foreign key does not become part of the child table's primary key, and,
therefore, is non-identifying. A solid line means that it is identifying.
The relational logical diagram uses the individual symbols, placed at each end
of the dotted or solid line between two tables, to express the full relationship
logical syntax. Table 9.3 contains three examples of relationships.
Table 9.3
Relationship (parent to child) Interpretation
Lesson Review
Objectives
Objectives
Understand
Understand aa relational
relational logical
logical model
model
Define
Defineand
anddescribe
describerelational
relationallogical
logical models
models
Define
Defineand
anddescribe
describetables
tablesand
andcolumns
columns
Define
Defineand
anddescribe
describerelationships
relationships
2. Describe tables.
Tables are how data is perceived in a relational logical model. Each
table must have a unique name. Rows of data must be unique. Tables in
the relational logical model represent what will become the physical
tables in the database.
3. Describe columns.
Columns are the divisions of data within a table. Column names within
a table must be unique. All values in a column must be the same type of
data. Columns must be non-decomposable. Columns in the relational
logical model represent what will become the physical columns in the
database.
4. Describe relationships.
Relationships represent the links between two tables. They enable you
to retrieve related data from more than one table. Relationships in the
relational logical model are enforced by foreign key constraints in the
physical database.
10 Module 9: Generating a Relational Logical Model
! What Is Normalization?
! What Is First Normal Form?
! What Is Second Normal Form?
! What Is Third Normal Form?
! Benefits of Normalization
! What Is Denormalization?
What Is Normalization?
! Definition
Normalization is the formal methods used to separate data
into multiple, related tables
! Tasks accomplished with normalization
" Minimized duplication of information
" Reduced data inconsistencies
" Faster data modification (insertions, updates, and
deletions)
! Definition
First Normal Form is the state of a database in which each
column contains a single type of information and there
are no repeating groups of data
Table 9.4
Customer-
Customer-Order
CustomerID LastName FirstName OrderID OrderDate Product Quantity
1108 Cary Richard 2667 05/03/2002 P11-3 5
1108 Cary Richard 2667 05/03/2002 L3-4 9
1256 Gambardella Matthew 7401 01/26/2001 P11-3 16
Primary key
Table 9.4
Customer-Order
CustomerID LastName FirstName OrderID OrderDate Product Quantity
1108 Cary Richard 2667 05/03/2002 P11-3 5
1108 Cary Richard 2667 05/03/2002 L3-4 9
1256 Gambardella Matthew 7401 01/26/2001 P11-3 16
Module 9: Generating a Relational Logical Model 13
! Definition
Second Normal Form is the state of a database in which
the database meets the requirements of 1NF and every
non-key column depends on the entire primary key
Table 9.5
Customer
CustomerID LastName FirstName SalesPersonID SalesPersonPhone
1108 Cary Richard 889709 01-99-999-9999
1256 Gambardella Matthew 223546 01-11-111-1111
Table 9.6
Order
OrderID OrderDate CustomerID
2667 05/03/2002 1108
7401 11/26/2001 1256
14 Module 9: Generating a Relational Logical Model
Table 9.7
OrderDetail
OrderID ProductID Quantity
2667 P11-3 5
2667 L304 9
7401 P11-3 16
Module 9: Generating a Relational Logical Model 15
! Definition
Third Normal Form is the state of a database in which the
database meets the requirements of 2NF, and every
non-key column depends only on the primary key
Table 9.8 Table 9.9
Customer Sales
CustomerID LastName FirstName SalesPersonID SalesPersonID Phone
1108 Cary Richard 889709 889709 01-99-999-9999
1256 Gambardella Matthew 223546 223546 01-11-111-1111
Table 9.10 Table 9.11
Order OrderDetail
OrderID OrderDate CustomerID OrderID ProductID Quantity
2667 05/02/2002 1108 2667 P11-3 5
7401 11/26/2001 1256 2667 L3-4 9
7401 L3-4 16
Primary key
*****************************ILLEGAL FOR NON-TRAINER USE******************************
Introduction Third Normal Form (3NF) builds on 2NF and is generally the highest level of
normalization that you will implement.
Definition Third Normal Form is the state of a database in which the database meets the
requirements of 2NF, and every non-key column depends only on the primary
key.
No column has a functional dependency on any column other than the primary
key.
Third Normal Form helps to avoid update and deletion anomalies, because all
data can be reached through foreign key values, and redundant data within each
table no longer exists. This level of normalization greatly increases database
integrity and generates a more optimized design.
Example Table 9.8, Table 9.9, Table 9.10, and Table 9.11 are examples of tables in
Third Normal Form
Table 9.8
Customer
CustomerID LastName FirstName SalesPersonID
1108 Cary Richard 889709
1256 Gambardella Matthew 223546
Table 9.9
Sales
SalesPersonID Phone
889709 01-99-999-9999
223546 01-11-111-1111
16 Module 9: Generating a Relational Logical Model
Table 9.10
Order
OrderID OrderDate CustomerID
2667 05/02/2002 1108
7401 11/26/2001 1256
Table 9.11
OrderDetail
OrderID ProductID Quatity
2667 P11-3 5
2667 L3-4 9
7401 L3-4 16
Module 9: Generating a Relational Logical Model 17
Benefits of Normalization
What Is Denormalization?
! Definition
Denormalization is the process of selectively duplicating
data in multiple tables
! Potential costs
" You must use code to maintain data consistency
" Data modifications will take longer to execute
" Write cost may exceed the read benefit
Lesson Review
Objectives
Objectives
Describe
Describe normalization
normalization
Define
Defineand
anddescribe
describethe
thefirst
first three
three forms
forms of
of
normalization
normalization
Describe
Describethe
the benefits
benefitsof
ofnormalization
normalization
Describe
Describedenormalization
denormalization
5. What are the problems associated with Table 9.12 in the preceding
example?
The job description for each job code is stored multiple times in the
table. This could lead to changes to the description in some rows but not
in others. It also means that the job description for a particular job
code will not exist in the database unless an employee has that job code.
Venue !
(ID) Att endeeCapacity+
owns has
VenueManager
Building !
(Number)
... approves use of. ..for... is in
Person ! Meeting
Location ! RoomNumber
(I D) (ID)
...has...f or... is hosted physically at has
{ 'Decline',
'Accept',
'Tentative' } Online !
(URL)
Status is hos ted electronically at has
AccessCode
MeetingOrganizer
Teleconferenc e !
proposes reoccurs
is hosted telephonically at has
>=2
Subject
T elephoneNumber
is used by reoccuring has
has
Time
Appointment ! (TimeValue)
(I D)
is used by one-time "Timeslot"
is related
P
Duration+
spans (ac,it) has **
Venue
PK Venu e ID
Location
Atten deeCapacity
Building
P K,FK 1 Build ing
PK B uildin g PK Room Nu mber
F K2,U 1 Venu e ID
T eleconference O nline
Meeting
PK Meeting ID
D uration Statu s
What Is a Project?
! Definition
A project is a Visio file that groups models and files that
are related to a single relational logical model
! Components
" Source models
" External objects
! Synchronization
Synchronization When working with projects, you will periodically synchronize the source
models with the collective relational logical model. This ensures that changes to
one model are reflected in the others.
Using Visio, you can manually update the source models with changes made to
the relational logical model. Visio will also automatically prompt you to do so
at specific times, such as when building the project after making changes to the
relational logical model. Visio synchronizes changes made to the source model
with the relational logical model when you build the project.
In general, make changes at the conceptual level and then rebuild the project.
26 Module 9: Generating a Relational Logical Model
Create
Create aanew
new database
databasemodel
model diagram
diagram
Add
Addananexisting
existingfile
fileto
tothe
theproject
projectand
andcheck
checkfor
for
errors
errors
Generate
Generatethe
thelogical
logicalmodel
model
Draw
Draw the
theelements
elementson
onthe
thedrawing
drawing surface
surface
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Lesson Review
Objectives
Objectives
Generate
Generate aa relational
relational logical
logical model
model from
from aa
conceptual
conceptual model
model
Create
Createand
and use
useaaproject
project
Draw
Drawaarelational
relationallogical
logicalmodel
modeldiagram
diagram
Module Review
For more information The procedures in this lab are a series of directives. If needed, refer to the
practices in the module for detailed implementation instructions. Additionally,
use the appendixes in this course for a symbol guide and a glossary of terms.
Scenario This lab uses the Academic Theme that you are already familiar with. Refer to
the scenario sections of each exercise for more information. An ORM source
model is provided that represents limited information about the campus
buildings and the employees that maintain them.
You will use the files in C:\MOC\2090\Labfiles\Lab09A to complete this
practice. Solution files for this practice are located in the Answer subdirectory
of that folder.
Estimated time to
complete this lab: 30
minutes
32 Module 9: Generating a Relational Logical Model
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
Module 9: Generating a Relational Logical Model 33
Exercise 1
Generating a Logical Model
In this exercise, you will be given an ORM source model for the Academic
Theme. You are to create a project, add the ORM source model to it, build the
project to generate the logical model, and draw the elements in the logical
model.
If needed, review the solution file for this exercise located in the
C:\MOC\2090\Labfiles\Lab09A\Answer folder.
34 Module 9: Generating a Relational Logical Model
Course Evaluation
Contents
Module Overview 1
Lesson: Refining Conceptual and Logical
Models 2
Lesson: Documenting Conceptual and
Logical Models 17
Module Review 25
Lab A: Completing the Baseline Model 26
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no
part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 10: Completing the Baseline Model iii
Instructor Notes
Presentation: This module provides students with the necessary knowledge and skills to
60 minutes interpret and refine logical models.
Lab:
30 minutes After completing this module, students will be able to:
! Complete a baseline model.
Refine conceptual and logical models.
Document conceptual and logical models.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_10.ppt
What Are Physical This page defines and describes physical names as they relate to ORM and
Names? relational logical modeling. Make sure that students understand that when they
change the physical names in the logical model, they must migrate those
changes back to the conceptual model, or they will be lost the next time the
project is built.
How to Set Physical This page instructs students on the high-level steps of how to set physical
Names names in the ORM model.
Practice: Setting This page reinforces the elements of the previous page through practice of the
Physical Names procedure by using the Scheduling Theme.
Scheduling Theme
In the relational logical model generated by this practice, the primary key for
the Person table is Person, the name of the table. By default, it would be
Employee ID. The Building table would be named Name Alpha by default.
Name is the entity object type identified in the primary reference scheme, and
Alpha is its reference mode.
This model provides an indication of the tradeoff when setting options. In this
case, eliminating the reference mode of Employee ID from the name caused it
not to appear as the primary key name, even though it would have been a good
choice. However, Name is a better starting point than Name Alpha, or Alpha
for the Building primary key. In general, use the reference mode when the
majority of the primary reference schemes in the ORM model are the reference
modes of the object types.
Module 10: Completing the Baseline Model v
Also, use this practice to explore the mapping that occurred based on the
options set prior to rebuilding the project. This will reinforce students
understanding of name mapping.
Important The practice has students attempt to close the relational logical
model to force Microsoft Visio Enterprise Architect edition to prompt them to
save the model and to migrate changes to the source model. Generally, you
would save a file prior to attempting to close it; however, Visio always prompts
to migrate changes when closing the model, even if they have already been
manually migrated or migrated on a save. The steps in the practice eliminate the
redundancy.
Next Steps This topic page serves as a reminder that students are not done with the
database design. After the database has generated the physical schema, there are
several more work items pending. However, these items are out of scope of this
course. You may instruct students to further their studies by attending Course
2072: Administering a Microsoft SQL Server 2000 Database and Course 2073:
Programming a Microsoft SQL Server 2000 Database.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
vi Module 10: Completing the Baseline Model
Module Review
After answering the questions, allow students to openly discuss any of the
topics covered.
Lab Setup
There are no lab setup requirements that affect replication or customization.
Lab Results
There are no configuration changes on student computers that affect replication
or customization.
Module 10: Completing the Baseline Model 1
Module Overview
! Definition
Data types define the specific kind of data that can be
stored in a column in a database
! Portable
! Physical
Select
Selectthe
theORM
ORMsource
source model
model
Set
Set the
thephysical
physicaldata
data types
typesin
inORM
ORM
Build
Build the
theproject
project
Examine
Examinethe
the column
columndata
datatypes
types
Note You must then execute an error check to ensure that the data type
sizing that you have set is within the limits of the database management
system to which the driver is set, in this case SQL Server 2000. For
example, char(30000) is invalid in SQL Server. Performing an ORM model
error check and building the project will not discover this type of error.
Module 10: Completing the Baseline Model 5
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Important This practice requires that the Visio database driver is set to
Microsoft SQL Server. Verify that this is the case by opening the Database
Drivers window from the Database, Options, Drivers menu, and verifying that
Microsoft SQL Server is selected. Close the window when done.
Important If you experience warnings or errors related to data types, make the
corrections in the ORM source model and rebuild the project so the corrections
are propagated throughout the relational logical model.
8 Module 10: Completing the Baseline Model
____________________________________________________________
4. Save the project and source models to their original locations and close
them.
Module 10: Completing the Baseline Model 9
! Definition
Physical names are the names assigned to elements of a
relational logical model that will generate like elements
in the physical schema with the same name
! Considerations
! Common options
Set
Set the
theVisio
Visio physical
physicalname
namegeneration
generation options
options
Build
Build the
theproject
projectto
togenerate
generatethe
the relational
relationallogical
logical
model
model
Change
Changethe
thephysical
physicalnames
nameswhere
where appropriate
appropriate
Tip Displaying both the conceptual and physical names on the relational
logical model will provide additional context for you when determining how to
set physical names.
12 Module 10: Completing the Baseline Model
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Note This project has been built previously, and the tables and
relationships drawn in the starting model. Building the project will update
the physical names in the relational logical model based on the options that
you set.
Note The physical names for each element appear first, followed by the
conceptual names in braces. Notice the lack of spaces in the physical names.
Also notice that the physical name of the key column does not contain the
reference mode as it would by default.
Next Steps
Lesson Review
Objectives
Objectives
Refine
Refine conceptual
conceptual and
and logical
logical models
models
Set
Set data
datatypes
types
Set
Set physical
physicalnames
names
Consider
Considernext
next steps
steps
! Use of reports
" Document your database design
" Summarize file and database statistics or to document
the tables in your model
" List data types in an object-relational model
" Identify problems with the model, such as entity types
without reference modes
! Conceptual
" Constraint Type
" Fact Type
" Object Type
" Supertype
! Logical
" Statistical
" Table
" Types
Logical The reports available in the database model diagram include those available
from ORM, plus Statistical, Table, and Types from the database model diagram
report menu.
! Statistical
Statistical reports provide a high-level summary of the contents of a
database model diagram.
! Table
Table reports show how objects in your model, such as tables and columns,
will appear in the database that you generate or update from the model.
! Types
Types reports show the composite, user-defined, and built-in data types
represented in your database model diagram.
You can also include attribute information such as type names, base types,
and derived types by using the Attributes tab in the Report dialog box.
Module 10: Completing the Baseline Model 21
Run
Run the
theReport
Report Generation
Generation Wizard
Wizard
Select
Select the
thetype
typeof
ofreport
report
Select
Select report
report options
optionsand
andgenerate
generatereport
report
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
Lesson Review
Objectives
Objectives
Document
Document conceptual
conceptual and
and logical
logical models
models
Differentiate
Differentiateconceptual
conceptualand
and logical
logical reports
reports
Generate
Generate reports
reports
Module Review
For more information The procedures in this lab are a series of directives. If needed, refer to the
practices in the module for detailed implementation instructions. Additionally,
use the appendixes in this course for a symbol guide and a glossary of terms.
Scenario This lab uses the Academic Theme that you are already familiar with. Refer to
the scenario sections of each exercise for more information. An ORM source
model is provided that represents limited information about the academic staff.
You will use the files in the C:\MOC\2090\Labfiles\Lab10 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
Estimated time to
complete this lab:
30 minutes
Module 10: Completing the Baseline Model 27
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
28 Module 10: Completing the Baseline Model
Exercise 1
Setting Physical Data Types
Scenario In this exercise, you will be given both an ORM source model based on the
Academic Theme and a project containing a previously generated and drawn
relational logical model. You will set the data types in the ORM source model
and rebuild the project to propagate the data types to a relational logical model.
Finally, you will run an error check on the logical model to ensure that the data
types meet the sizing criteria for SQL Server 2000.
Academic char(8)
Date datetime
Degree char(3)
Name varchar(30)
UniversityCode char(4)
____________________________________________________________
Module 10: Completing the Baseline Model 29
Exercise 2
Setting Physical Names
Scenario In this exercise, you will set Visio physical name generation options, rebuild the
model, and change specific names in the relational logical model.
Exercise 3
Generating Reports
In this exercise you will generate Visio reports to view their content and gain an
understanding of their utility.
Practice
! Run the report generation wizard and select the type of report
You will be generating the report based on the
GenerateReport_Academic_Project.vsd project and its corresponding ORM
source model.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
Microsoft, MS-DOS, Windows, Windows NT, Outlook, PowerPoint, Visio, and Visual Studio are
either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Portions of this work are used with permission from the book, Information Modeling and
Relational Databases, by Terry Halpin, 2001 by Morgan Kaufmann Publishers. All rights
reserved.
Module 11: Generating and Reverse Engineering Physical Schema iii
Instructor Notes
This module teaches students the skills and knowledge necessary to create a
database from a relational logical model, and also how to create a relational
logical model from an existing database.
Presentation: After completing this module, students will be able to:
75 minutes
! Transfer a data model to and from Microsoft SQL Server 2000.
Lab:
Generate a database from a relational logical model.
30 minutes
Update a database with a modified relational logical model.
Reverse engineer a database into a relational logical model.
Required materials To teach this module, you need the following materials:
! Microsoft PowerPoint file 2090A_11.ppt
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
Module 11: Generating and Reverse Engineering Physical Schema v
Lesson Review
Review each lesson objective and ensure that students have an opportunity to
ask questions. After answering the questions, allow students to openly discuss
any of the topics covered.
Module Review
After answering the questions, allow students to openly discuss any of the
topics covered.
Lab Setup
No lab setup requirements affect replication or customization.
Lab Results
No configuration changes on student computers affect replication or
customization.
Module 11: Generating and Reverse Engineering Physical Schema 1
Module Overview
! Forward Engineering
! Reverse Engineering
! Definition
Forward engineering is the process of generating a new database or
updating an existing database from a relational logical model
SQL
Execute
Execute the
theGenerate
Generate Wizard
Wizard
Create
Create the
theinitial
initialDSN
DSN
Generate
Generatethe
thedatabase
database
Review
Review the
thedatabase
database
Note You can also create the DDL script and use it to manually create the
database by using a tool such as SQL Query Analyzer. In either case, the
database schema will be the same.
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model 3 00
4 00
5 00
Important The practices in this module require that the Visio database driver is
set to Microsoft SQL Server. Verify that this is the case by opening the
Database Drivers window from the Database, Options, Drivers menu, and
then verifying that Microsoft SQL Server is selected. Close the window when
done.
Table 11.1
Item Selection or input
Important In this practice, Visio creates the database and log files on the
same drive. In reality, you must place them on separate disk drives to be
able to recover the database in the event of disk failure.
4. In the Microsoft Visio dialog box, click Yes when asked whether you want
to view the generated DDL script.
Visio opens the Code Editor window displaying the DDL script that was
used to create the database.
Module 11: Generating and Reverse Engineering Physical Schema 7
5. Review the generated DDL and the progress information in the Database
Model Diagram window and in the Visio Output window to become
familiar with their contents.
Make
Make changes
changesto
to the
theexisting
existingmodel
model
Run
Run the
theUpdate
Updatewizard
wizard
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Starting Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model Model 3 00
4 00
5 00
112039 04/07/1950
231156 04/07/1950
115324 03/04/1953
298843 02/18/1983
Table 11.4
Item Selection or input
3. In the Update Wizard dialog box, in the Installed Visio drivers box, select
Microsoft SQL Server.
Module 11: Generating and Reverse Engineering Physical Schema 11
Table 11.5
Item Selection or input
3. In the Connect Data Source window click OK, and then click Finish.
Lesson Review
Objectives
Objectives
Generate
Generateaa database
databasefrom
from aarelational
relationallogical
logicalmodel
model
Update
Updateaadatabase
databasewith
with aamodified
modified relational
relational logical
logical
model
model
! Definition
Reverse engineering is the process of creating a model from an
existing database schema
! Relational logical model
Author Author writes Book Book
! ORM Book
Title
(TitleID)
writes / is written by has
Author
(AuthorID)
LastName
has
ORM It is out of the scope of this course to cover all the details of the limitations of
reverse engineering into ORM. However, the information in Table 11.6 details
a few of the pending work items that could exist.
Table 11.6
Pending work item Cause
Create
Create aaDatabase
DatabaseModel
ModelDiagram
Diagram
Reverse
Reverseengineer
engineerthe
theexisting
existingdatabase
database
! Purpose
! Scenario
! Practice
8 am
Out of Office:
9 00 Doctors Appt
Manager
1:1 All-han
10 00 Quaterl
Team
Meeting Meetin Off-sit
11 00 Traini
Brownbag Class
12 pm Lunch: ORM
Solution 1 00
2 00
Data
Modeling
Project
Data
Modeling
Project
Model 3 00
4 00
5 00
Table 11.7
Item Action
When you click Finish, Visio will reverse engineer the Scheduling database
and layout the elements on the drawing surface.
3. Review the items on the drawing surface and their properties and compare
them with the database by using SQL Server Enterprise Manager.
4. On the Visio menu bar, click Database, point to View, and then click Code.
Examine the check constraint code that Visio imported from the Room
table. In the Code window, notice that the fully qualified name indicates on
which object the constraint is found.
Note Even though the value check constraint does not appear as a
constraint on the Room table in the Database Properties window, Visio does
associate it with the Capacity column in that table and will generate it on the
Capacity column when forward engineering this model into a new database.
5. On the Visio menu bar, click File, click Save, and close your models.
20 Module 11: Generating and Reverse Engineering Physical Schema
Lesson Review
Objective
Objective
Reverse
Reverseengineer
engineeraadatabase
databaseinto
into aarelational
relational logical
logical
model
model
Module Review
! Forward Engineering
! Reverse Engineering
Scenario You will use the Academic Theme that you are already familiar with in this lab.
In the first exercise, you will work with an existing database project to generate
a new physical database.
In the second exercise, you will refine the model, rebuild the project, and
update the physical database with those changes.
In the third exercise, you will reverse engineer the SQL Server database schema
into a relational logical model and review the contents of the logical schema.
You will use the files in the C:\MOC\2090\Labfiles\Lab11 folder to complete
this practice. Solution files for this practice are located in the Answer
subdirectory of that folder.
Estimated time to
complete this lab:
30 minutes
24 Module 11: Generating and Reverse Engineering Physical Schema
Exercise 0
Lab Setup
! Log on to Microsoft Windows
1. Press CTRL+ALT+DEL to open the logon screen.
2. Type Studentxx in the User Name box, where Studentxx is the user name
assigned to you at the beginning of the class.
3. Type the password that you established for this account in the Password
box.
4. Ensure that NWTRADERS is listed in the Domain box.
5. Click OK.
Module 11: Generating and Reverse Engineering Physical Schema 25
Exercise 1
Generating a Database from a Logical Model
The goal of this exercise is for you to generate a database from a logical model.
In this exercise, you will use the Generate Wizard to generate the Academic
database. You will then compare tables in the database schema with the
corresponding entities in the logical model.
Important The exercises in this lab require that the Visio database driver is set
to Microsoft SQL Server. Verify that this is the case by opening the Database
Drivers window from the Database, Options, Drivers menu, and verifying that
Microsoft SQL Server is selected. Close the window when done.
Note The DDL used to enforce the exclusive-or constraint across the roles
associated with whether an Academic is either tenured or has a contract
date. He or she must have one or the other.
go
go
Exercise 2
Updating an Existing Database
In this exercise, you will use Visio to add two new fact types to the ORM
source model. You will then rebuild the project, and, finally, run the Update
Wizard to make the changes permanent in the database.
Exercise 3
Reverse Engineering an Existing Database
In this exercise, you will reverse engineer the Academic database you
previously updated and review its design in a Database Model Diagram. You
will not work with ORM during this exercise.
Course Evaluation