Language:EN
Pages: 19
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
database design supertypes and subtypescopyright

Database design supertypes and subtypescopyright

Database Design

Objectives

3

Supertypes and Subtypes

Purpose

CASH

• Imagine a business which

CHECK

needs to track payments
from customers. CREDIT CARD• Customers can pay by cash,
by check, or by credit card.

Evaluating Entities

• All payments have some common

CASH
CHECK

• And for credit card and check
payments, we may need to know CREDIT CARD

which CUSTOMER made the
payment, while this is not needed for cash payments.

Evaluating Entities

• Should we create a single PAYMENT entity or three

CASH

subdivide an entity into subtypes. •

ANIMAL

• In this case, the entity is called a

• A subtype:
– Inherits all attributes of the supertype

– Inherits all relationships of the

INVERTEBRATE

– Never exists alone

Supertype Example

• EXAM is a supertype of
take

QUIZ, MIDTERM, and

* description

• The subtypes have

several attributes in

BONUS

MIDTERM

• These common QUESTION

attributes are listed at

included in

• The same applies to STUDENT
take

relationships.

* description

• Subtypes inherit all
BONUS

MIDTERM

relationships of the

EXAM SUPERTYPE

• This idea leads to the two subtype rules:
– Exhaustive: Every instance of the supertype is also an instance of one of the subtypes. All subtypes are listed without
omission.

– Mutually Exclusive: Each instance of a supertype is an instance of only one possible subtype.

12

Always More Than One Subtype

make sure that your subtypes

WALLPAPER

WALLCOVERING SUPERTYPE

• But being able to subtype is not

PAINT

the issue—having a reason to

WALLPAPER
FABRIC
• When a need exists within the OTHER

then subtype.

14

(exhaustive)

– Does each instance fit into one and

OTHER
ANIMAL
VERTEBRATE
BIRD

“readability” -- you would

MAMMAL

OTHER

Terminology

Key terms used in this lesson included:

17

Supertypes and Subtypes

Summary

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Anthony Hammond

PageId: DOC46D7E94