منتدى قسم تكنولوجيا المعلومات في مدرسة الدوحة الثانوية المستقلة للبنين
علمت أن رزقي لن يأخذه غيري فاطمأن قلبي

قم وذق طعم الصلاة في دجى الليل الطويل

قم وجاهد في الحياة ان مثوانا قليل
منتدى قسم تكنولوجيا المعلومات في مدرسة الدوحة الثانوية المستقلة للبنين
علمت أن رزقي لن يأخذه غيري فاطمأن قلبي

قم وذق طعم الصلاة في دجى الليل الطويل

قم وجاهد في الحياة ان مثوانا قليل
منتدى قسم تكنولوجيا المعلومات في مدرسة الدوحة الثانوية المستقلة للبنين
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

منتدى قسم تكنولوجيا المعلومات في مدرسة الدوحة الثانوية المستقلة للبنين

من أفضل مدارس قطر
 
الرئيسيةأحدث الصورالتسجيلدخول
قال الامام احمد بن حنبل: إن لنا إخوان لانراهم إلا مره كل سنه , نحن اوثق بمودتهم ممن نراهم كل يوم .أسعد الله قلوبا طاهره إن وصلناها شكرت وإن قصرنا عذرت
من العظماء من يشعر المرء فى حضرته أنه صغير ولكن العظيم بحق هو من يشعر الجميع في حضرته بأنهم عظماء
كم في المقابر من يحسدونك على هذه الأيام والليالي التي تعيشها يتمنون لو تسبيحة أو استغفار ينفعهم عند ربهم أو سجدة تنير قبورهم أو صدقة تظلهم بين يدي الملك الجبار .. فقط تذكر .. ولا تضيع الفرصة التي بين يديك

 

 Relationship Type Constraints

اذهب الى الأسفل 
2 مشترك
كاتب الموضوعرسالة
A.Tamimi
Admin
A.Tamimi


Posts : 1593
أهمية العضو : 16
Join date : 13/11/2008
Age : 39
Location : Jordan

Relationship Type Constraints Empty
مُساهمةموضوع: Relationship Type Constraints   Relationship Type Constraints Emptyالأحد نوفمبر 16, 2008 3:35 am

Relationship Type Constraints
The constraints of relationship types limit the possible combination of entities that participate in the relationship set. Two main types of constraints is mapping cardinality and participation
Mapping Cardinality
Mapping Cardinality describes the maximum number of entities that a given entity can be associated with via a relationship. In this section, we consider only the cardinality constraint for the binary relationship. The possible cardinality for binary relationship types are : One - to- One (1-1) , One – to – Many (1 – N) and Many – to – Many (M-N).

* One to one relationship: Given two entity sets A and B, there is a one-to-one relationship between A and B if each entity in the set A is associated with at most one entity in the set B and vice versa each entity in the set B is associated with at most one entity in the set A.

Relationship Type Constraints Graphi32
Figure 15: One-to-one relationship example
Example: An employee if is a manager then can manage one department and a department can have only one manager.

Relationship Type Constraints Graphi32
Figure 16: One-to-one relationship notation

* One to many relationship: There is a one to many relationship sets associates two entities sets A and B if each entity in A is associated with several entities in B however, each entity in B is associated with at most one entity in A.

Relationship Type Constraints Graphi33
Figure 17: One-to-many relationship example
Example: There are many employees work in a department however, an employee can work for only one department.

Relationship Type Constraints Graphi34
Figure 18: One-to-many relationship notation

* Many to many relationship : There is a many to many relationship sets associates two entities sets A and B if each entity in A is associated with several entities in B however, each entity in B is associated with several entities in A.

Relationship Type Constraints Graphi35
Figure 19: Many-to-many relationship example
Example: An employee can join in several projects and a project can have several employees

Relationship Type Constraints Graphi36
Figure 20: Many-to-many relationship notation
Participation
The participation constraints specifiy whether the existence of an entity depends on its being related to another entity via the relationship type.
Participation in relationship set R by entity set A may be

* Total : It means every entity a in A participates in at least 1 relationship in R
* Partial: It means only some a in A participate in relationships in R

Example Every project have at least 1 employee joined in it.
Not every employee in the company join in a project

Relationship Type Constraints Graphi37
Figure 21: Participation in relationship notation
Attributes of Relationship Types
The relationship types can have attributes like entity types. For 1-1 and 1-N relationship types, attributes of the relationship can be migrated to one of the participating entity types. However, for M-N relationship types, attributes must be specified as the relationship attribute.
Example: The StartDate attribute records the date on which an employee joins in a project

Relationship Type Constraints Graphi38
Figure 22: Attribute in relationship example
Weak Entity Type
Weak entity types are those whose existence depends on the existence of other entity type. Entities belongs to weak entity type are identified by being related to specific entities from another entity type which is called strong entity types.
The weak entity type does not have key attributes of their own. The keys of this type os partially or totally derived from strong entity types.
In ER diagram, weak entity and strong/weak relationship are denoted by double box/diamond
Example: Entity type DEPENDENT related to EMPLOYEE. This entity type is used to keep track of the dependents of each employees via 1-N relationship. DEPENDENT entity has Name, Birthdate and Relationship. Two dependents of two distinct employees might have the same {Name, Birthdate, Relationship} values but they are totally different. They are identified as distinct only after consider the association with particular employee entities to which the dependents relates. So the key of the DEPENDENT might be {EID, Name} in which EID is the attribute from the strong entity type EMPLOYEE.

Relationship Type Constraints Graphi39
Figure 23: Weak entity type notation
Entity Relationship Diagram for COMPANY database
Modeling Entities:

Relationship Type Constraints Graphi40
Figure 24: Entities of COMPANY database

Relationship Type Constraints Graphi41
Figure 25: Entities of COMPANY database
Modeling Relationships

Relationship Type Constraints Graphi44
Figure 26: Relationships of COMPANY database

Relationship Type Constraints Thumb110


ليتك تحلو والحياة مريره وليتك ترضى والانام غضاب
وليت الذى بينى وبينك عامر وبينى وبين العالمين خراب
إذا صحّ منك الود فالكل هيّن وكل الذى فوق التراب تراب

اللهم ارحم موتانا وموتى جميع المسلمين
اللهم أنزل على قبورهم الضياء والنور والفسحة والسرور وجازهم بالاحسان إحسان وبالسيئات عفوا وغفرانا
الرجوع الى أعلى الصفحة اذهب الى الأسفل
https://falcons.aforumfree.com
M.ALS3OD

M.ALS3OD


Posts : 854
أهمية العضو : 0
Join date : 13/09/2009
Age : 30
Location : AMMAN

Relationship Type Constraints Empty
مُساهمةموضوع: رد: Relationship Type Constraints   Relationship Type Constraints Emptyالسبت سبتمبر 19, 2009 7:13 pm

يـــعـــطـــيـــك الـــعـــافـــيـــة
الرجوع الى أعلى الصفحة اذهب الى الأسفل
 
Relationship Type Constraints
الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1
 مواضيع مماثلة
-
» Data Modeling Using Entity-Relationship Model

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
منتدى قسم تكنولوجيا المعلومات في مدرسة الدوحة الثانوية المستقلة للبنين :: ----§§§§ المنتديات التقنية والبرمجية §§§§---- :: قسم نظم التشغيل واللينكس-
انتقل الى: