Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Systems Instructor Name: Lecture-8.

Similar presentations


Presentation on theme: "Database Systems Instructor Name: Lecture-8."— Presentation transcript:

1 Database Systems Instructor Name: Lecture-8

2 Contents Relationship Attribute on Relationship Associative Entity 2

3 Relationship An relationship is an association that represent the interaction among Entity Instances of one or more Entity Types that is of interest to the organization It is Verb or Verb Phrase 3

4 Relationship Type An relationship Type is an Abstraction of Meaningful Associations among Entity Types It can answer the questions that is of interest to the organizations and these Answers cannot be answered by only using Entity Types 4

5 Relationship Instance
It is an association between/ among entity instances where each relationship instance associates with exactly one entity instance from participating Entity Types A relationship instance in an E-R schema represents an association between the named entities in the real-world enterprise that is being modeled. 5

6 Relationship Set It is a set of associations or relationships among entities from participating Entity Types Formally, it is a mathematical relation on n ≥ 2 (possibly nondistinct) entity sets. If E1, E2, , En are entity sets, then a relationship set R is a subset of {(e1, e2, . . ., en) | e1 ∈ E1, e2 ∈ E2, , en ∈ En} Alternatively, it can be defined as a subset of the Cartesian product of the entity sets E1 ×E2 × ... × En 6

7 Relationship Set-Contd.
if A, B are sets, then a relation R is a subset of A  B A={1,2,3}, B={a,b,c,d}, A  B = {(1,a),(1,b), . . ., (3,d)} R = {(1,a), (1,c), (3,b)} - makes is a subset of Product  Company: 1 2 3 a b c d A= B= makes Company Product 7

8 Participation and Role
The association between Entity Sets is called Participation that is the Entities E1,E2,E3,…,En participate in a relationship R. The function that an entity plays in a relationship is called that entity’s role. It defined whether an Entity Instance of one Entity Type can exist without participating with an Entity Instance of another Entity Type. The Role is implicit unless there is a Recursive Relationship 8

9 Relationship – Participation
9

10 Relationship - Role 10

11 Example – Relationship Type, Relationship Instance and Relationship Set
11

12 Relationship Instances
12

13 Attribute on Relationship
It is a relationship that is dealt as an attribute in some situations. In other words, attributes may be related with relationships Where we can place the attribute Date Complete?(next slide) There is a value of the date for each instance of relationship Important Attribute on Relationship only occur in many-to-many relationship They do not occur in one-to-one or one-to-many relationship 13

14 Attribute on a Relationship – Contd.
14

15 Attribute on a Relationship- Contd.
15

16 Attribute on a Relationship- Another Example
A student is assigned to a supervisor on a specific date 16

17 Associative Entity A solution to attribute on relationship Associative entity An entity type that associates the instances of one or more entity types and contains attributes that are peculiar to the relationship between those entity instances. Entity Type-Noun Relationship - Verb 17

18 Associative Entity – Defining Rules
The participating entity types are in “many” relationships Resulting Associative Entity has independent meaning to the end user The associative entity has one ore more attribute along-with Identifier Attribute The associated entity participate in one or more relationship independent of the entities associated in the relationship 18

19 Assignment – What I was Expecting
major Department offers Is double major allowed? Can a student have more than 1 advisor? Is joint appointment of faculty possible? Can two profs share to teach the same course? Can a professor teach more than one course? Can a professor stay without affiliated with a department? faculty Courses teaches Professor advisor enrollment Students 19

20 ???????????????? 20


Download ppt "Database Systems Instructor Name: Lecture-8."

Similar presentations


Ads by Google