D1101174GC10 Ag

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

This document should not be distributed.

For Instructor Use Only.


Data Modelling and Design

Activity Guide
D1101174GC10

Learn more from Oracle University at education.oracle.com


Author Copyright © 2021, Oracle and/or its affiliates.

Vasily Strelnikov Disclaimer

This document contains proprietary information and is protected by copyright and other
Technical Contributor intellectual property laws. You may copy and print this document solely for your own use in an
and Reviewer Oracle training course. The document may not be modified or altered in any way. Except where
your use constitutes "fair use" under copyright law, you may not use, share, download, upload,
Joe Greenwald copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this
document in whole or in part without the express authorization of Oracle.
Graphic Designers The information contained in this document is subject to change without notice and is not
Kavya Bellur warranted to be error-free. If you find any errors, please report them to us in writing.
Komal Reenu
Restricted Rights Notice
Editors

This document should not be distributed.


If this documentation is delivered to the United States Government or anyone using the
Nikita Abraham documentation on behalf of the United States Government, the following notice is applicable:
Aju Kumar U.S. GOVERNMENT END USERS: Oracle programs (including any operating system,
Moushmi Mukherjee integrated software, any programs embedded, installed or activated on delivered hardware, and
modifications of such programs) and Oracle computer documentation or other Oracle data
delivered to or accessed by U.S. Government end users are "commercial computer software" or
Publishers "commercial computer software documentation" pursuant to the applicable Federal Acquisition

For Instructor Use Only.


Pavithran Adka Regulation and agency-specific supplemental regulations. As such, the use, reproduction,
Sujatha Nagendra duplication, release, display, disclosure, modification, preparation of derivative works, and/or
Srividya Rameshkumar adaptation of i) Oracle programs (including any operating system, integrated software, any
Giri Venugopal programs embedded, installed or activated on delivered hardware, and modifications of such
programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the
rights and limitations specified in the license contained in the applicable contract. The terms
governing the U.S. Government's use of Oracle cloud services are defined by the applicable
contract for such services. No other rights are granted to the U.S. Government.
1002122021
Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.

Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC
trademarks are used under license and are trademarks or registered trademarks of SPARC
International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of
Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

Third-Party Content, Products, and Services Disclaimer

This documentation may provide access to or information about content, products, and services
from third parties. Oracle Corporation and its affiliates are not responsible for and expressly
disclaim all warranties of any kind with respect to third-party content, products, and services
unless otherwise set forth in an applicable agreement between you and Oracle. Oracle
Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred
due to your access to or use of third-party content, products, or services, except as set forth in
an applicable agreement between you and Oracle.
Table of Contents

Practices for Lesson 1: Introduction to Modeling ......................................................................... 5


Practices for Lesson 1: Overview ................................................................................................... 6
Practice 1-1: Identify Key Business Information ............................................................................. 7
Solution for Practice 1-1 .................................................................................................................. 9

This document should not be distributed.


Practice 1-2: Identify Candidate Entities and Attributes ................................................................. 10
Solution for Practice 1-2 .................................................................................................................. 11
Practices for Lesson 2: Create the Entity-Relationship Model .................................................... 13
Practices for Lesson 2: Overview ................................................................................................... 14
Practice 2-1: Create the Initial ER Model ........................................................................................ 15

For Instructor Use Only.


Solution for Practice 2-1 .................................................................................................................. 17
Practice 2-2: Verify and Improve the ER Model.............................................................................. 18
Solution for Practice 2-2 .................................................................................................................. 19
Practices for Lesson 3: Normalization ........................................................................................... 27
Practices for Lesson 3: Overview ................................................................................................... 28
Practices for Lesson 4: Design and Implement Data Models ...................................................... 35
Practices for Lesson 4: Overview ................................................................................................... 36

Copyright © 2021, Oracle and/or its affiliates.

Data Modelling and Design – Table of Contents iii


This document should not be distributed.
For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

iv Data Modelling and Design – Table of Contents


Practices for Lesson 1:
Introduction to Modeling

For Instructor Use Only.


This document should not be distributed.
Practices for Lesson 1: Overview

Overview
In these practices, you will cover the following topics:
 Practice 1-1: Given a business description, identify business objectives, assumptions,
critical success factors, key performance indicators (KPIs), and problems
 Practice 1-2: Using interview notes, identify business functions and entities and
attributes

This document should not be distributed.


For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

6 Practices for Lesson 1: Introduction to Modeling


Practice 1-1: Identify Key Business Information

Overview
In this practice, you will use an interview with the CEO of a major law firm to identify key
business information that will serve as the beginning of your data modeling analysis.

Tasks
1. Read the interview notes below.

This document should not be distributed.


2. Identify and write down:
a. Business objectives
b. Assumptions
c. Critical success factors
d. Key performance indicator (KPI) problems

For Instructor Use Only.


e. Problems

Source—Interview with the CEO of Bailey and Associates Law Firm


“Our mission is to provide to our clients the highest quality, world class legal services and be a
key part of our client’s journey to success, supported by our highly qualified and skilled team.
We are focused on delivering excellent results for our clientele. Our success is dependent on
our close coordination between our clients and our attorneys.
Our firm grew faster than we had imagined and now there are ‘cases lying all over the place.’
Due in part to the large growth, we have had issues with document and case tracking. We do
not want to risk cases being lost due to documents being lost or mishandled. We must stay
compliant with regulations.
Given our current manual and paper-based processes, we are limited in how many new cases
can be handled by our team. We’d like to be able to leverage our excellent staff to deliver our
world class services to even more clients. Ideally, we’d like to increase case volume by 10% in
five years. Currently, different staff use different means of tracking cases and volume and
billing. Some use spreadsheets and some use paper and pencil. We need to address these
bottlenecks by introducing a comprehensive, accurate, fast, and cost-effective and convenient
reporting system.
To meet these goals, we need to automate our case and document management systems.
The systems must be easy to use for those who are not computer literate, and we want current
modern looking applications that utilize web and mobile, so that our lawyers, legal assistants
and clerical staff can easily access their casework from anywhere.
Ideally, we would like our clients to be able to track their case progress online as well.
We also hope that the automation will improve productivity by automating ad hoc processes so
that our team uses the same systems and processes, thus improving cost effectiveness of the
services that we offer. We are aiming at improving our margin by at least 8% over the next three
years. We also think that by all staff using the same processes, we may be able to better predict

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 1: Introduction to Modeling 7


our case success percentage, staff retention, and customer satisfaction will not be negatively
impacted.
Our revenue margin should be at least 20% and staff retention should be below 5% turnover.
The new system must at least meet these measures.
Current processes are hard to use and so it is difficult to retain newer, qualified staff. An
automation would reduce tedious workload on our staff with the expected increase in morale
and retention.”

This document should not be distributed.


For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

8 Practices for Lesson 1: Introduction to Modeling


Solution for Practice 1-1

Business objectives
 Increase case volume by 10 percent in five years
 Improve margin by at least 8 percent over the next three years

Assumptions
 Easy-to-use system for those who are not computer literate

This document should not be distributed.


 Current modern-looking applications that utilize web and mobile

Critical success factors


 Close coordination between our clients and our attorneys
 Stay compliant with regulations

For Instructor Use Only.


Key performance indicators (KPIs)
 Revenue margin should be at least 20 percent
 Staff retention should be below 5 percent turnover

Problems
 Cases being lost due to documents being lost or mishandled

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 1: Introduction to Modeling 9


Practice 1-2: Identify Candidate Entities and Attributes

Overview
In this practice, you will identify candidate business functions, entities, and their attributes.

Tasks
1. Read the interview notes below.
2. Identify and write down:

This document should not be distributed.


a. Business functions
b. Entities
c. Attributes

Source: Interview with senior partner

For Instructor Use Only.


“I’m Alan Cheetham, the senior partner in a large, diversified law firm. My firm, Bailey and
Associates, handles a wide variety of cases including traffic violations, domestic disputes, civil
suits, and homicide cases.
We assign cases to attorneys to handle the legal proceedings. The attorneys need to be able to
find their cases and the events associated with their cases on a regular basis and in a timely
fashion.
Events have special codes like O for Open, T for Trial, and L for Lost, and there must always be
an event status for every case. It’s crucial to log the exact date and time when the actions on a
case occurred for both billing and activity tracking purposes. Cases can be closed and
reopened.
The information we need to keep about a case includes its description, as well as a complete list
of related documents.
The case is created on behalf of a client the firm represents. Some clients are individuals, and
some are organizations.”

Copyright © 2021, Oracle and/or its affiliates.

10 Practices for Lesson 1: Introduction to Modeling


Solution for Practice 1-2

Function candidates
 Handle case
 Assign attorney
 Search and find case
 Create case
 Create event

This document should not be distributed.


 Find event
 Bill client
 Record activity
 Close case

For Instructor Use Only.


 Reopen case

Entity/Attribute Candidates
 Partner, Associate, Attorney, Lawyer, Client, Person
 Name
 Organization, Firm
 Name
 Case
 Type, Description, Documents
 Action, Event
 Code, Date, Time

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 1: Introduction to Modeling 11


This document should not be distributed.
For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

12 Practices for Lesson 1: Introduction to Modeling


Create the Entity-
Relationship Model
Practices for Lesson 2:

For Instructor Use Only.


This document should not be distributed.
Practices for Lesson 2: Overview

Overview
In these practices, you will:
 Create the initial ER model
 Refine the model and resolve M:M relationships, identify and model subtypes and arcs,
and identify UIDs

This document should not be distributed.


For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

14 Practices for Lesson 2: Create the Entity-Relationship Model


Practice 2-1: Create the Initial ER Model

Overview
In this practice, you will create the initial ER model, discover and document entities, add
attributes, and add relationships.

Tasks
1. Read the interview notes below.

This document should not be distributed.


2. Identify and write down the:
a. Entities and their attributes
b. Relationships between the entities
In this practice, you are creating the initial ER model. Do not try to resolve M:M
relationships or add subtypes, UIDs, or any other design patterns. You will do this

For Instructor Use Only.


incrementally in the following practices.

Source: Interview with Alan Piper (AP), Legal Assistant


Analyst: Do you run into any challenges with international addresses, given the wide variation in
address formats?
AP: Actually, that is a constant source of confusion and pain. We have had several situations
where, due to an incorrect address format, the client did not receive correspondence.
Analyst: Can you give me some examples of this?
AP: Yes, one happened recently. Sometimes, addresses start with a house name or number,
but some overseas clients put the city or town first. Imagine the confusion of sending something
to Paris which we thought was the city but was in fact the house name!
The other issue is that overseas zip codes or postal codes, as they are sometimes called, are
always numeric—they can be a combination of numbers and letters.
Analyst: Tell me about the process when you take on a new client. What information do you
initially record about that person?
AP: Remember, it’s not always an individual; it could be an organization.
Analyst: When it’s an organization, do you always need to know the contact?
AP: Yes, and sometimes there are more than one. For each client or representative of an
organization, I need to write down their full name and how they prefer their honorific: Mr., Ms.,
Mrs., Dr., etc. And of course, their email address, phone number, and postal address, and
sometimes we have a primary mailing address that could be different from the billing address.
Analyst: Could you have a situation where multiple people have the same address?
AP: This does happen, for example, when we contact different employees in the same office.
Analyst: What are your other responsibilities, apart from creating cases?
AP: As a case progresses, I need to record all the individuals and organizations that take part in
the case activities and the specific role they play.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 2: Create the Entity-Relationship Model 15


Analyst: Is it possible for an individual or organization to participate in multiple actions or events
in different cases?
AP: Yes. Not only that, but some may play different roles within the same case. For example,
the same party can be both the defendant and witness in the same case.
Analyst: So, what are these different types of roles a party can play?
AP: Plaintiff, witness, defendant, judge, an expert in some field, or an attorney.
Analyst: Can your firm’s attorneys or judges be considered as parties to the case?
AP: Absolutely. And I must record the information about their involvement as well.

This document should not be distributed.


Analyst: Please tell me about events that occur. What information do you record?
AP: All attorneys and legal assistants record their own activities, which include the date and
time when an activity occurred, a short description, and a duration, and in the case of witnesses,
defendants, and judges, a list of who was involved. We also need to indicate if this event is
billable or not.
Analyst: Is there anything else you record for cases?

For Instructor Use Only.


AP: Yes, we need to know which documents were used in a case.

Hints
 Identify candidate entities and attributes.
 Identify candidate relationships.
 Draw a draft diagram.
 Validate your diagram by applying reading rules for entities, attributes, and
relationships.
 Make corrections to your diagram as required.

Copyright © 2021, Oracle and/or its affiliates.

16 Practices for Lesson 2: Create the Entity-Relationship Model


Solution for Practice 2-1

This document should not be distributed.


For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 2: Create the Entity-Relationship Model 17


Practice 2-2: Verify and Improve the ER Model

Overview
In this practice, you will discover and document unique identifiers, resolve many-to-many
relationships, and identify potential supertype-subtypes or arc cases.

Tasks
1. Referring to the Practice 2-1 solution, write down what additional questions you would ask
the legal assistants’ team to deepen your understanding of their business and to resolve

This document should not be distributed.


model issues.

For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

18 Practices for Lesson 2: Create the Entity-Relationship Model


Solution for Practice 2-2

Solution for Step 1

Notes
 This solution contains follow-up questions from the analyst, as well as answers
provided by a member of the legal assistants’ team.
 The text of this solution is the basis for the next practice step.

This document should not be distributed.


Source: Follow-up interview with Alan Piper’s team of legal assistants
Analyst: Is there any difference in mailing and billing addresses?
AP’s team: No, apart from the fact that a certain address is preferred to be used as the billing
address by a person or organization.
Analyst: Is there any difference between recording an address for a person or organization?

For Instructor Use Only.


AP’s team: Yes, organizations frequently use PO boxes. People can use PO boxes, but rarely
do so.
Analyst: Can the same party in a case be both an organization and a person?
AP’s team: No.
Analyst: You have mentioned “party” numerous times. How is that different from a person or
organization being involved in a case?
AP’s team: A party to a case describes the involvement of a person or organization, and that
plays a specific role in the case.
Analyst: Is there any specific information about the party itself that you record?
AP’s team: Yes, the person or organization, the type of role they are playing, and the case they
are party to.
Analyst: Is it true that each event can only involve one case, and that the event is always
caused by a specific party?
AP’s team: Yes. For example, assigning a witness to a case or a judge presiding over a case is
always related to the specific case and the specific party.
Analyst: Can different events occur on the same case at the same time?
AP’s team: Yes, if they are created by different parties.
Analyst: What specific information do you record about documents?
AP’s team: For each document, we need to know its specific format (for example, PDF, Word,
Excel, etc.). But most importantly, it needs to be linked to the case.
Analyst: You mentioned you need to track documents used in cases. Can a document be used
in more than one case? Or used more than once in a given case?
AP’s team: Yes and yes.
Analyst: Is the document related to the event in any way?
AP’s team: It might be, but it is definitely related to the case.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 2: Create the Entity-Relationship Model 19


Analyst: When a document is related to an event, what extra information do you record about
that compared to a document linked to a case?
AP’s team: No extra information, really, just the fact that the document may have been
produced or used (for example, a document from a witness deposition).

2) Given these additional questions and responses, update the model to reflect your new
understanding.

This document should not be distributed.


For Instructor Use Only.
Hints
 Questions and answers in the interview should help establish unique identifiers,
resolve many-to-many relationships, and identify potential supertype-subtypes or arc
cases.
 The next several pages contain solutions for this practice. These solutions are
presented as a series of steps:
a) Write down key pieces of information from the interview.
b) Add newly discovered or modify existing attributes.
c) Resolve many-to-many relationships.
d) Add supertype-subtypes.
e) Add unique identifiers.
 Read and validate the newly refined model.

Copyright © 2021, Oracle and/or its affiliates.

20 Practices for Lesson 2: Create the Entity-Relationship Model


Solution for Step 2.a: Document Key Pieces of Information from the Interview

This document should not be distributed.


For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 2: Create the Entity-Relationship Model 21


Solution for Step 2.b: Add Newly Discovered or Modify Existing Attributes

This document should not be distributed.


For Instructor Use Only.
Note: Attribute duration is considered to be a derivable from the difference between the start
and the end times.

Copyright © 2021, Oracle and/or its affiliates.

22 Practices for Lesson 2: Create the Entity-Relationship Model


Solution for Step 2.c: Resolve M:M Relationships and Identify Arcs

This document should not be distributed.


For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 2: Create the Entity-Relationship Model 23


Solution for Step 2.d: Model Subtypes and Supertypes

This document should not be distributed.


For Instructor Use Only.
Note: Country information appears to be common for any type of contact, regardless of a
specific subtype. The reason country is not modeled as just an attribute within the supertype is
because country has its own attributes and thus should be modeled as a distinct entity.

Copyright © 2021, Oracle and/or its affiliates.

24 Practices for Lesson 2: Create the Entity-Relationship Model


Solution for Step 2.e: Add Unique Identifiers

This document should not be distributed.


For Instructor Use Only.
Note: The participation of parties in events is reflected via the Involvement intersection entity
that emerged as a result of a many-to-many relationship resolution between the Party and the
Event entities. However, as a result, a direct relationship between Party and Event is no longer
present. This wouldn’t have been a problem if not for the fact that the Event needs this
relationship link to the Party to act as part of its own Unique Identifier because each Event is
identified by a Party that has created this Event, the Case, and the Start Time.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 2: Create the Entity-Relationship Model 25


This document should not be distributed.
For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

26 Practices for Lesson 2: Create the Entity-Relationship Model


Normalization
Practices for Lesson 3:

For Instructor Use Only.


This document should not be distributed.
Practices for Lesson 3: Overview

Overview
In these practices, you will take a denormalized set of data and incrementally normalize the data
to Third Normal Form (3NF).

Tasks
1. Put this data into 0 Normal Form (0 NF).

This document should not be distributed.


PK

PARTY_CODE ROLE EMAIL NAME ID DESCRIPTION DATE_TIME

PL17 Plaintiff [email protected] Joe Bloggs 101 Open case 2020-01-10 11:59:00

107 Provide information 2020-01-12 10:15:00

WT42 Witness [email protected] Joe Bloggs 105 Assign witness 2020-01-12 11:55:00

For Instructor Use Only.


DEF3 Defendant [email protected] John Dow 102 Open case 2020-01-10 12:03:00

AT7 Attorney [email protected] Jane Smith 103 Assign to the case 2020-01-11 09:23:00

104 Interview plaintiff 2020-01-12 10:15:00

110 Review documents 2020-01-15 17:38:00

LA7 Legal Assistant [email protected] Marry Ann 106 Take notes 2020-01-12 10:15:00

108 Prepare supporting documents 2020-01-12 14:30:00

LA5 Legal Assistant [email protected] Lucy Law 109 Prepare supporting documents 2020-01-14 09:00:00

Hint: This is the data in its raw or “natural” form. The key was pre-selected to get you started on
the normalization process. In order to reach 0 NF, all attributes should represent atomic values.
This means that a field containing a composite value, i.e., PARTY_CODE, needs to be
decomposed into separate components.

Copyright © 2021, Oracle and/or its affiliates.

28 Practices for Lesson 3: Normalization


Solution for Step 1: Put Data into 0 Normal Form (0 NF)

Note: The decomposed PARTY_CODE becomes two columns that together form a primary key
(PK) for this table.
PK

ROLE_CODE PARTY_ID ROLE EMAIL NAME ID DESCRIPTION DATE_TIME

PL 17 Plaintiff [email protected] Joe Bloggs 101 Open case 2020-01-10 11:59:00

107 Provide information 2020-01-12 10:15:00

WT 42 Witness [email protected] Joe Bloggs 105 Assign witness 2020-01-12 11:55:00

This document should not be distributed.


DEF 3 Defendant [email protected] John Dow 102 Open case 2020-01-10 12:03:00

AT 7 Attorney [email protected] Jane Smith 103 Assign to the case 2020-01-11 09:23:00

104 Interview plaintiff 2020-01-12 10:15:00

110 Review documents 2020-01-15 17:38:00

LA 7 Legal Assistant [email protected] Marry Ann 106 Take notes 2020-01-12 10:15:00

For Instructor Use Only.


108 Prepare supporting documents 2020-01-12 14:30:00

LA 5 Legal Assistant [email protected] Lucy Law 109 Prepare supporting documents 2020-01-14 09:00:00

Note: Always check that the data satisfies the 0 NF rule before starting transition to 1 NF.

2. Normalize data to 1 Normal Form (1 NF).

Hint: Any columns that have more than one value per single value of the PK need to be moved
to a separate table. A new PK needs to be selected for that new table, and a foreign key (FK)
referencing the original table should be created in the new table.

3. Solution for Step 2: Normalize Data to 1 Normal Form (1 NF)

Notes
 Columns ID, DESCRIPTION, and DATE_TIME appear to have more than one value per
single value of the PK of a table, so they had to be moved into a new table.
 An ID column is the best candidate for the PK in this new table.
 An FK was added to this new table to reference an original table from which columns
were extracted.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 3: Normalization 29


PK

ROLE_CODE PARTY_ID ROLE EMAIL NAME

PL 17 Plaintiff [email protected] Joe Bloggs

WT 42 Witness [email protected] Joe Bloggs

DEF 3 Defendant [email protected] John Dow

AT 7 Attorney [email protected] Jane Smith

LA 7 Legal Assistant [email protected] Marry Ann

LA 5 Legal Assistant [email protected] Lucy Law

This document should not be distributed.


PK

FK

ID ROLE_CODE PARTY_ID DESCRIPTION DATE_TIME

101 PL 17 Open case 2020-01-10 11:59:00

107 PL 17 Provide information 2020-01-12 10:15:00

For Instructor Use Only.


105 WT 42 Assign witness 2020-01-12 11:55:00

102 DEF 3 Open case 2020-01-10 12:03:00

103 AT 7 Assign to the case 2020-01-11 09:23:00

104 AT 7 Interview plaintiff 2020-01-12 10:15:00

110 AT 7 Review documents 2020-01-15 17:38:00

106 LA 7 Take notes 2020-01-12 10:15:00

108 LA 7 Prepare supporting documents 2020-01-12 14:30:00

109 LA 5 Prepare supporting documents 2020-01-14 09:00:00

Note: Always check that the data satisfies the 0 and 1 NF rules before starting the transition to
2 NF.

4. Normalize the data to 2 NF.

Hint: Any non-key columns that are dependent on part of the key rather than the whole key
should be moved to a new table together with the column that is the part of the key on which
they depend, which would become a PK in the new table. The original table should retain this
key column as part of its PK, but also make it an FK referencing the new table.

Copyright © 2021, Oracle and/or its affiliates.

30 Practices for Lesson 3: Normalization


Solution for Step 3: Normalize the Data to 2 NF

Notes
 A non-key column, ROLE, appears to have a dependency on column ROLE_CODE, so
it should be moved to a new table.
 ROLE_CODE would become a PK in this new table.
 ROLE_CODE also becomes an FK in the original table, referencing the new table.
 No changes need to be applied to the third table as it only has one column in its PK and,
therefore, is not contradicting the 2 NF rule.

This document should not be distributed.


PK
PK
ROLE_CODE ROLE
FK
PL Plaintiff
ROLE_CODE PARTY_ID EMAIL NAME
DEF Defendant
PL 17 [email protected] Joe Bloggs
AT Attorney

For Instructor Use Only.


WT 42 [email protected] Joe Bloggs
LA Legal Assistant
DEF 3 [email protected] John Dow
WT Witness
AT 7 [email protected] Jane Smith

LA 7 [email protected] Marry Ann

LA 5 [email protected] Lucy Law

PK

FK

ID ROLE_CODE PARTY_ID DESCRIPTION DATE_TIME

101 PL 17 Open case 2020-01-10 11:59:00

107 PL 17 Provide information 2020-01-12 10:15:00

105 WT 42 Assign witness 2020-01-12 11:55:00

102 DEF 3 Open case 2020-01-10 12:03:00

103 AT 7 Assign to the case 2020-01-11 09:23:00

104 AT 7 Interview plaintiff 2020-01-12 10:15:00

110 AT 7 Review documents 2020-01-15 17:38:00

106 LA 7 Take notes 2020-01-12 10:15:00

108 LA 7 Prepare supporting documents 2020-01-12 14:30:00

109 LA 5 Prepare supporting documents 2020-01-14 09:00:00

Note: Always check that the data satisfies the 0, 1, and 2 NF rules before starting the transition
to 3 NF.

5. Normalize the data to 3 NF.

Hint: Any non-key columns that are dependent on another non-key column should be moved to
a new table. A column on which other columns depend would become a PK in the new table.
The original table should retain this column as the FK referencing the new table.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 3: Normalization 31


Solution for Step 5: Normalize the Data to 3 NF

Notes
 A non-key column, NAME, appears to have a dependency on column EMAIL, so they
should be moved to a new table.
 EMAIL would become a PK in this new table.
 EMAIL also becomes an FK in the original table, referencing the new table.
 No changes need to be applied to other tables as they do not appear to have any non-
key column dependencies.

This document should not be distributed.


PK PK

FK FK EMAIL NAME

ROLE_CODE PARTY_ID EMAIL [email protected] Joe Bloggs

PL 17 [email protected] [email protected] John Dow

DEF 3 [email protected] [email protected] Jane Smith

For Instructor Use Only.


AT 7 [email protected] [email protected] Marry Ann

LA 7 [email protected] [email protected] Lucy Law

LA 5 [email protected]

PK

ROLE_CODE ROLE

PL Plaintiff

DEF Defendant

WT Witness

LA Legal Assistant

AT Attorney

PK

FK

ID ROLE_CODE PARTY_ID DESCRIPTION DATE_TIME

101 PL 17 Open case 2020-01-10 11:59:00

107 PL 17 Provide information 2020-01-12 10:15:00

105 WT 42 Assign witness 2020-01-12 11:55:00

102 DEF 3 Open case 2020-01-10 12:03:00

103 AT 7 Assign to the case 2020-01-11 09:23:00

104 AT 7 Interview plaintiff 2020-01-12 10:15:00

110 AT 7 Review documents 2020-01-15 17:38:00

106 LA 7 Take notes 2020-01-12 10:15:00

108 LA 7 Prepare supporting documents 2020-01-12 14:30:00

109 LA 5 Prepare supporting documents 2020-01-14 09:00:00

Copyright © 2021, Oracle and/or its affiliates.

32 Practices for Lesson 3: Normalization


Note: Always check that the data satisfies 0, 1, 2, and 3 NF at the end of the normalization
process.
The final solution for this practice can be represented as the following table model:

This document should not be distributed.


For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 3: Normalization 33


This document should not be distributed.
For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

34 Practices for Lesson 3: Normalization


Models
Practices for Lesson 4:
Design and Implement Data

For Instructor Use Only.


This document should not be distributed.
Practices for Lesson 4: Overview

Overview
In these practices, you will:
 Analyze nonfunctional requirements (NFRs) that affect database model implementation
decisions
 Produce a table model from the Entity-Relationship model

Tasks

This document should not be distributed.


1. Analyze nonfunctional requirements (NFRs) for the database model.
Source: System design specification document
Information about cases and events must be stored in Oracle Relational Database.
Implementation considerations include the following:

For Instructor Use Only.


 An artificial (surrogate) integer ID column must be added to tables to act as a primary
key for each table.
 Natural unique identifiers should be implemented as unique keys.
 Check constraint should be used to enforce that the “Is Billable” column only contains
“Y” or “N” character values.
 CASE is a SQL keyword; thus, it should be avoided as a table name.
 An integer version column must be added to each table to support the optimistic
locking mechanism.
 Date and time values must be stored as timestamps.
 Long text descriptions must use Varchar type and allow up to 2000 characters in
length.
 Short titles text should also be of the Varchar type and allow up to 200 characters in
length.
2. Produce a table model for the EVENT and CASE entities from the following Entity-
Relationship model (assume that PARTY has already been transformed into a table):

Copyright © 2021, Oracle and/or its affiliates.

36 Practices for Lesson 4: Design and Implement Data Models


Solution:

This document should not be distributed.


For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

Practices for Lesson 4: Design and Implement Data Models 37


This document should not be distributed.
For Instructor Use Only.

Copyright © 2021, Oracle and/or its affiliates.

38 Practices for Lesson 4: Design and Implement Data Models

You might also like