Database Foundations 3-3: Normalization and Business Rules Practices

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5
At a glance
Powered by AI
The document discusses database normalization and bringing tables to first, second and third normal forms. It provides examples and steps to normalize tables to each form.

The three normal forms discussed are first normal form, second normal form, and third normal form.

The steps to normalize a table to first normal form are to eliminate repeating groups of data and ensure each field contains a single value.

www.oracle.

com/academy

Database Foundations
3-3 : Normalization and Business Rules
Practices
Exercise 1: Relational Databases

Overview
In this practice you will analyze the given table structure and bring the table to the specified normal form.

Tasks
1. Analyze the given table which is not normalized. The table holds information specific to items such as the Item ID, Color of the
item, and the Unit price of each of the item. Some of the rows in the table have repeating group of information. Evaluate the data
in the table and bring the table to first normal form:
Item ID Color Unit Price
IT001 Red, Blue $16.56
IT002 Yellow $17.48
IT003 Green $19.76
IT004 Blue, Yellow $20.00

2. Analyze the given table. The table is in the first normal form and has composite primary key made up of the Suppler ID and Store
Id. The non-key attribute location is only dependent on the Store ID.
Evaluate the data stored in the table and bring the table to second normal form:
Supplier ID Store ID Location
SP001 S1 New York
SP001 S3 Vermont
SP002 S1 New Hampshire
SP003 S2 Rhode Island
SP004 S3 Illinois

3. Analyze the given table and the data stored. In the table the Book ID is the primary key and the Category Description is
dependent on the Category ID. Evaluate the data stored in the table and eliminate the transitive dependency to bring the table to
the third normal form:
Book ID Category ID Category Desc Price
1 1 Cooking $27.99
2 2 Travel $17.99
3 1 Cooking $20.99
4 3 Computers $40.99
5 2 Travel $19.99

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
2

Exercise 2: Normalize Academic Database ERD

Overview
In this practice, you use un-normalized database models to create normalized database models.

Tasks
1. For the Academic Database ERD, evaluate each entity against the rules of normalization, identify the misplaced attributes, and
explain which rule of normalization each misplaced attribute violates.

PARENT INFORMATION STUDENT


# ID be for ACADEMIC SESSION
# ID
* Parent 1 First Name # ID
* First Name
* Parent 1 Last Name * Name
* Last Name
o Parent 2 First Name * Registration Year
have
o Parent 2 Last Name * Email schedule
* Number of Working Days
* Number of Days Off
o Eligibility for Exam
be for be for
STUDENT COURSE DETAIL
EXAM RESULT
* Grade
have * Grade
have
be for given in
be for

have
COURSE
# ID have
* Name
DEPARTMENT give
offer offered by
# ID be for
* Name
* Head held
have held
be for have
contain

host host EXAM


# ID
belong to ONLINE SEATED * Type
# Logon ID # Building o Start Date
* Password # Room * Name
FACULTY # Date/Time o Description
# ID
* First Name
* Last Name
* Email
* Login Date
* Login Time be for
o Details
have
FACULTY COURSE DETAIL
FULL TIME
* Contact Hours
* salary
* insurance plan be for

PART TIME
* hourly rate

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
3

Exercise 3: Validate an ERD for Normalization

Tasks
1. Evaluate the following unnormalized data in the USER entity and develop an entity relationship diagram that is normalized to third
normal form.

User User Message Recorded Subject Text Server Server


ID Name ID Date ID Name

2301 Smith 54101 05/07 Meeting Today There is… 3786 IMAP05

2301 Smith 54098 07/12 Promotions I like to… 3786 IMAP05

2301 Smith 54445 10/06 Next Your next… 3786 IMAP05


Assignment

5607 Jones 54512 06/07 Lunch? Can You… 6001 IMAP08

5607 Jones 54101 05/07 Meeting Today There is… 6001 IMAP08

5607 Jones 54660 12/01 Jogging Today? Can you… 6001 IMAP08

7773 Walsh 54101 05/07 Meeting Today There is… 9988 EMEA01

7773 Walsh 54554 03/17 Stock Quote The 9988 EMEA01


latest…

0022 Patel 54101 05/07 Meeting Today There is… 9988 EMEA01

0022 Patel 54512 06/07 Lunch? Can you… 9988 EMEA01

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
4

2. A color scheme for a car includes specifications for paint color for the body and the interior colors and materials. For example:
The “Desert” color scheme includes silver paint and gray leather interior; the “Sunburst” color scheme includes gold paint and
cream leather interior. Does the model below follow the rules of Third Normal Form? If you spot a violation, correct it.

CAR
# number
* make
* model
* color scheme
* paint color
* interior color

Exercise 4: Gather database requirements and Business Rules

Overview
In this practice you will analyze the case scenario provided and identify business rules.

Tasks
1. Book.com is an online store on the Internet where customers can browse the catalog and select products of interest.
a. Every book has a title, isbn, year and price. The store also keeps the author and publisher for any book.
b. For authors, the database keeps the name, address and the url of their homepage.
c. For publishers, the database keeps the name, address, phone number and the url of their website.
d. The store has several warehouses, each of which has a code, address and phone number.
e. The warehouse stocks several books. A book may be stocked at multiple warehouses.
f. The database records the number of copies of a book stocked at various warehouses.
g. The bookstore keeps the name, address, email-id, and phone number of its customers.
h. A customer owns several shopping carts. A shopping cart is identified by a Shopping_Cart_ID and contains several
books.
i. Some shopping carts may contain more than one copy of same book. The database records the number of copies of each
book in any shopping cart.
j. At that time, more information will be needed to complete the transaction. Usually, the customer will be asked to fill or
select a billing address, a shipping address, a shipping option, and payment information such as credit card number. An
email notification is sent to the customer as soon as the order is placed.

Your task is to identify the business rules.

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
5

2. Identify if the given description can be categorized as a Structural Business rule, Procedural Business rule or Programmatic
Business rule.

Business Rule Structural Business Procedural Programmatic


Rule Business Rule Business Rule

All teachers in our


school must
possess a valid
teaching certificate
Each Department
must offer a Course

Approval of travel
requests to an event
must be signed by
the project manager
of the event
A customer may
make numerous
payments on
account
A machine operator
may not work more
than 10 hours in a
day
The Rental amount
in RENTAL is
calculated from
the Rental rate
multiplied by the
number of days

A Customer can
have zero, one or
many ORDERS

The Total cost of the


RENTAL is
calculated from the
sum of Insurance
amount, Rental
amount, and Late
charge

A customer’s debt
must not exceed the
customer’s credit
limit.

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy