EER to Realtional Mapping. (Lecture 12) презентация

Mapping Specialization (Step 8) k a1 a2 an S1 S2 Sm . . . . . . C R – relation Attrs(R)

Слайд 1IE301 Analysis and Design of Data Systems Lecture 12
EER to Relational Mapping
Aram Keryan



Слайд 2
Mapping Specialization (Step 8)
k






a1
a2
an
S1
S2
Sm
. . .
. . .


C
R – relation
Attrs(R) –

attributes of R
PK(R) – primary key of R
C – superclass
{S1, S2, … , Sm} – m subclasses
{k, a1, a2 ...an} – attributes of C
k – primary key

Let’s denote:


Слайд 3Mapping Specialization
Option 8A: Multiple relations—superclass and subclasses
This option works for any

specialization (total or partial, disjoint or overlapping)

Create a relation L for C with attributes Attrs(L) = {k, a1, ..., an} and PK(L) = k.
Create a relation Li for each subclass Si, 1 ≤ i ≤ m, with the attributes
Attrs(Li) = {k} ∪ {attributes of Si} and PK(Li) = k

k

a1

a2

. . .

an

C

k

atr1

attr2

. . .

S1

k

atr1

attr2

. . .

S2

k

atr1

attr2

. . .

Sm



Слайд 4Option 8A: Example



Слайд 5Mapping Specialization
Option 8B: Multiple relations—subclass relations only
This option works for total

disjoint specializations


Create a relation Li for each subclass Si, 1 ≤ i ≤ m, with the attributes
Attrs(Li) = {attributes of Si} ∪ {k, a1, ..., an} and PK(Li) = k

atr1

attr2

. . .

S1

k

a1

a2

. . .

an

atr1

attr2

. . .

S2

k

a1

a2

. . .

an

atr1

attr2

. . .

S3

k

a1

a2

. . .

an

. . .


Слайд 6

Option 8B: Example


Слайд 7Mapping Specialization
Option 8C: Single relation with one type attribute
Create a single

relation L with attributes
Attrs(L) = {k, a1, ..., an} ∪ {attributes of S1} ∪ ... ∪ {attributes of Sm} ∪ {t} and PK(L) = k. The attribute t is called a type attribute whose value indicates the subclass to which each tuple belongs, if any.

This option works only for disjoint specializations, and has the potential for generating many NULL values
These options is not recommended if many specific attributes are defined for the subclasses


Слайд 8
Option 8C: Example


Слайд 9Mapping Specialization
Option 8D: Single relation with multiple type attributes
Create a single

relation schema L with attributes
Attrs(L) = {k, a1, ..., an} ∪ {attributes of S1} ∪ ... ∪ {attributes of S m} ∪
∪ {t1, t2, ..., tm} and PK(L) = k.
Each ti, 1 ≤ i ≤ m, is a Boolean type attribute indicating whether a tuple belongs to subclass Si

This option works for overlapping specializations, and has the potential for generating many NULL values (but will also work for a disjoint specialization).
These options is not recommended if many specific attributes are defined for the subclasses


Слайд 10Option 8D: Example


Слайд 12Option 8A is used for PERSON/{EMPLOYEE, ALUMNUS, STUDENT} relation


Слайд 13
Option 8C is used for the EMPLOYEE/ {STAFF, FACULTY, STUDENT_ASSISTANT} relation
Option

8D is used for the STUDENT_ASSISTTANT/{RESEARCH_ASSISTANT, TEACHING_ASSISTANT}

Слайд 15
Option 8D is used for the STUDENT relation


Слайд 16Mapping of Union Subclasses (Step 9)


Слайд 17Mapping of Union Subclasses (Step 9)
When a union subclass is defined

by superclasses that have different keys a
surrogate key is used. For union subclass a separate relation is created with a surrogate key in a role of a primary key. Also a surrogate key is included as a foreign key in each relation corresponding to superclass. It is also recommended to add a type attribute to the relation corresponding to union subclass to indicate the particular entity type to which each tuple belongs.

Обратная связь

Если не удалось найти и скачать презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое ThePresentation.ru?

Это сайт презентаций, докладов, проектов, шаблонов в формате PowerPoint. Мы помогаем школьникам, студентам, учителям, преподавателям хранить и обмениваться учебными материалами с другими пользователями.


Для правообладателей

Яндекс.Метрика