Fig211 11 Relationship Fig212 1M Relationship Fig213 M N Relationship 28 Data

Fig211 11 relationship fig212 1m relationship fig213

This preview shows page 3 - 6 out of 15 pages.

Fig.2.11 (1:1 Relationship) Fig.2.12 (1:M) Relationship) Fig.2.13 (M: N) Relationship)
Image of page 3
28 Data Base Management systems Notes Amity Directorate of Distance & Online Education Relationship of the higher degree In the previous section of relationship, we have discussed unary and binary relationships. In this section we will discuss about ternary and recursive relationships. Ternary Relationship: In the real world there are relationships other than those involving two things. For example, suppose that we want to capture which employees use which skills on which project. We might try to represent this data in a database as three binary relationships between skills and project, project and employee, and employee and skill. Fig. 2.14 An example of having three binary relationships The applies relationship indicates which employee applies which skill. The used on relationship indicates which skill is used on which project. The works on relationship indicates which employee works on which project. But this is not enough to specify which employee uses which skill on which project. Suppose you know the following: works-on John and Smith have worked on projects A and B. applies John has used skills interface design and database design while Smith only used his database design skill. used on Both skills have been used on both projects. Given this information, it is impossible to figure out on which projects John used which skills. He could have used interface design on project B and database design on project A---or the other way around. Or he might have used both skills on both projects. The database simply does not give us enough information. In order to capture the necessary information the database needs a ternary relationship. In this case the database needs a relationship, called used- on, among employee, skill, and project. Fig 2.15 an example of ternary relationship Fig 2.16
Image of page 4
Data Base Management systems 29 Notes Amity Directorate of Distance & Online Education The used on relationship stays the same as in the previous ER diagram. The binary relationships are different. has-skill An employee has a certain skill. This is different than used on because there are some skills that an employee has that an he or she may not have used on a particular project. needed A project needs a particular skill. This is different than used on because there may be some skills for which employees have not been assigned to the project yet. manages An employee manages a project. This is a completely different dimension than skill so it could not be captured by used on. The used on relationship captures information three pieces at a time. Recursive Relationship This is a relationship that an entity has with itself. To better understand this, consider an employee who is the manager of other employees. Fig 2.17 manager manages many employees and an employee has exactly one direct manager.
Image of page 5
Image of page 6

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture