3. Transformation EER diagram in relations:
• In this we will convert ER
and EER diagrams that were
developed in conceptual
design into Relational
database schemas.
• By using the following steps:
•نمودن تبدیل پروسه از عبارت
های دیاگرامERوEER(در که
بود شده ساخته مفهومی دیزاین)به
میباشد ها جدول.
•ذیل مراحل استفاده با:
Computer Science Faculty, Database1 3
4. 1. Map regular entities:
• Each regular entity type in
an ER Diagram is
transformed into a relation.
• Name same as to entity
name.
• Attributes become
attributes of relation.
• Identifier become Primary
key.
•یک در عادی موجودیت نوع هر
دیاگرامERتبدیل جدول یک به
میشود.
•چیز یک موجودیت نام با آن نام
میباشد.
•صفات موجودیت خاصه صفات
میگیرد قرار جدول خاصه.
•،شناسهمیشود جدول اصلی کلید.
Computer Science Faculty, Database1 4
6. In case of composite attributes:
• When any entity have
composite attributes ,only
the simple component
attributes of the composite
attribute are included in
the new relation.
•خاص صفات موجودیت یک وقتیکهه
صفا فقط ،باشد داشته را مرکبت
خاصه صفت ساده جزئی خاصه
جدید جدول شامل را مرکب
میسازیم.
Computer Science Faculty, Database1 6
7. In case of composite attributes…
Computer Science Faculty, Database1 7
8. Multi value attribute:
• When a regular entity type
contains a multi valued
attribute, two new relations
are created .
• First Relation contain all of
the attributes of the entity
type except the multi
valued attribute.
• Second Relation contain
primary key ,plus its
attribute.
•عادی موجودیت نوع یک زمانیکه
قیمته چندین خاصه صفت دارای
ساخته جدید جدول دو پس باشد
میشود.
•خاصه صفات تمام اول جدول
چن خاصه صفت از بجز موجودیتد
بوده داراء را قیمته.
•با اصلی کلید شامل دوم جدول
قیمته چند خاصه صفت اضافه
میباشد.
Computer Science Faculty, Database1 8
10. 2. Map weak entity:
• Weak entity has no
independence existence
,but exists only through an
identifying relationship with
another entity type called
the owner.
a) For each weak entity
create a relation associate
its attributes.
•مستق وجود هیچ ضعیف موجودیتل
موجودی توسط میتواند اما ،نداشتهت
شود موجود قوی.
(aیک ضعیف موجودیت هر برای
صفات تمام و بسازید را جدول
ستون منحیث را موجودیت خاصه
دهید قرار جدول های.
Computer Science Faculty, Database1 10
11. 2. Map weak entity…
b) Include the primary key of
the identifying relation as a
foreign key attribute in this
new relation.
• For example: Driver
,,,,license
• When driver die its license
finish automatically.
(bرا قوی موجودیت اصلی کلید
جدول در خارجی کلید منحیث
دهید قرار جدید.
•مثال بطور:لسانس و راننده
•آن لسانس میرد می راننده زمانیکه
میکند پیدا خاتمه.
Computer Science Faculty, Database1 11
12. 3. Map binary relationship:
• Binary relationship is
mapped according to its
cardinalities.
1. Mapping binary 1:M
relationships:
• First create two tables for
each entity.
•کاردینال براساس دوگانه ارتباطیتی
آنmapمیشود.
.1چ به یک دوگانه ارتباط نگاشتند:
•هر برای را جدول دو ابتدا
کنید درست موجودیت.
Computer Science Faculty, Database1 12
13. 3. Map binary relationship…
• Next include the primary
key attribute of the entity
on the one side of the
relationship as a foreign key
in the relation that is on the
many side of the
relationship.
• Example as of customer
and order.
•ایک موجودیت اصلی کلید سپسدر ه
دارد قرار ارتباط یگانه سمت
ایک موجودیت خارجی کلید منحیثه
قرا دارد قرار ارتباط چند سمت درر
دهید.
•مثال بطور:customerوorder
Computer Science Faculty, Database1 13
15. 3. Map binary relationship…
2. Map Binary M:M:
• When two entities have
M:M relationship then we
create a new relation C.
• This new relation contains
primary key of both
Relations (A and B).
•دوگانه ارتباط نگاشتبه چندچند:
•ب چند ارتباط موجودیت دو زمانیکهه
جدو یک ما سپس باشد داشته چندل
جدیدCمیسازیم را.
•د هر اصلی کلید شامل جدید جدولو
جدولAوBمیباشد.
Computer Science Faculty, Database1 15
22. Continue…
• Sometimes the data
modeler assign an identifier
called surrogate identifier,
to the associative entity
type on ER Diagram.
•یک دیتا ساز مدل اوقات بعضی
شرکت موجودیت نوع به را شناسه
شن بنام که میکند تعیین پذیراسه
میشود یاد جایگزین.
Computer Science Faculty, Database1 22
24. 5. Map Unary Relationships:
• Also called recursive
relationship.
• The two most important
cases are:
1. One to many
2. Many to Many
• A relation is formed for
entity.
• Then a foreign attribute is
added within the same
relation that references the
primary key value.
•بنام همچنان یک درجه ارتباط
میشود یاد بازگشتی ارتباط.
•دارد حالت سه:
•یک به یک
•چند به یک
Computer Science Faculty, Database1 24
25. Continue…
1. Unary one to many
relationship:
• The entity type in the unary
relationship is mapped to a
relation.
• Then a foreign key attribute
is added to the same
relation that references the
primary key values in the
same relation.
•یک درجه چند به یک ارتباط:
•یک درجه ارتباط در موجودیت نوع
میشود نگاشته جدول یک به.
•خارجی شناسه خاصه صفت سپس
به که شده اضافه جدول عین به
خود در اصلی کلید های قیمت
میدهد مرجع جدول.
Computer Science Faculty, Database1 25
31. 7. Map super type/subtype relations:
• Create a separate relation
for the super type and for
each of its sub types.
• Assign the attributes that
are common to all members
of the super type, including
the primary key to the
relation created for the
super type.
•برای جدا جدول یکsuper type
از یک هر برای وsub typeها
بسازید.
•برای ایکه جدول بهsuper type
شده ساختهattributeرا های
تمام بین که بدهیدsub typeها
اص کلید شمول به هستند مشترکلی.
1:55 AM
Gharjistan University Computer Science
Faculty Farah Branch
31
32. Continue…
• Assign the primary key of
the super type and only
those attributes that are
unique to the sub type to
the relation for each sub
type.
• Assign one (or more)
attributes of the super type
to function as the sub type
discriminator.
•از یک هر برای ایکه جدول به
sub typeکلید میشود ساخته ها
اصلیsuper typeفقط و
attributeهمان به مربوط هایکه
sub typeبدهید است.
•ک تفکیک منحیث ایکه تابع بهننده
sub typeا بیشتر یا و یک بودهز
خاصه صفت یکsuper typeرا
بدهید.
1:55 AM
Gharjistan University Computer Science
Faculty Farah Branch
32