Representing Entity sets in ER Diagram Entity sets can be represented graphically as follows: Rectangles represent entity sets. Attributes listed inside entity rectangle Underline indicates primary key attributes instructor student D D name name salary tot cred Database System Concepts-7th Edition 6.12 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 6.12 ©Silberschatz, Korth and Sudarshan th Edition Representing Entity sets in ER Diagram ▪ Entity sets can be represented graphically as follows: • Rectangles represent entity sets. • Attributes listed inside entity rectangle • Underline indicates primary key attributes
Relationship Sets A relationship is an association among several entities Example: 44553(Peltier) advisor 22222(Einstein) student entity relationship set instructor entity A relationship set is a mathematical relation among n>2 entities,each taken from entity sets {(e1,e2,.en)|e1∈E1,e2∈E2,,en∈Enl where (e1,e2,...,e)is a relationship ·Example: (44553,22222)∈advisor Database System Concepts-7th Edition 6.13 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 6.13 ©Silberschatz, Korth and Sudarshan th Edition Relationship Sets ▪ A relationship is an association among several entities Example: 44553 (Peltier) advisor 22222 (Einstein) student entity relationship set instructor entity ▪ A relationship set is a mathematical relation among n 2 entities, each taken from entity sets {(e1 , e2 , … en ) | e1 E1 , e2 E2 , …, en En } where (e1 , e2 , …, en ) is a relationship • Example: (44553,22222) advisor
Relationship Sets (Cont.) Example:we define the relationship set advisorto denote the associations between students and the instructors who act as their advisors. ■ Pictorially,we draw a line between related entities. 76766 Crick 98988 Tanaka 45565 Katz 12345 Shankar 10101 Srinivasan 00128 Zhang 98345 Kim 76543 Brown 76543 Singh 76653 Aoi 22222 Einstein 23121 Chavez instructor 44553 Peltier student Database System Concepts-7th Edition 6.14 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 7 6.14 ©Silberschatz, Korth and Sudarshan th Edition Relationship Sets (Cont.) ▪ Example: we define the relationship set advisor to denote the associations between students and the instructors who act as their advisors. ▪ Pictorially, we draw a line between related entities
Representing Relationship Sets via ER Diagrams Diamonds represent relationship sets. instructor student ID advisor D name name salary tot_cred Database System Concepts-7th Edition 6.15 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 6.15 ©Silberschatz, Korth and Sudarshan th Edition Representing Relationship Sets via ER Diagrams ▪ Diamonds represent relationship sets
Relationship Sets (Cont.) An attribute can also be associated with a relationship set. ■ For instance,the advisorrelationship set between entity sets instructor and student may have the attribute date which tracks when the student started being associated with the advisor 76766 Crick 98988 Tanaka 45565 Katz 3May2008 12345 Shankar 10June2007 10101 Srinivasan 00128 12June2006 Zhang 98345 Kim 6 June 2009 76543 Brown 76543 Singh 30June2007 76653Aoi 31May2007 22222 Einstein 23121 Chavez 4May2006 instructor 44553 Peltier student Database System Concepts-7th Edition 6.16 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 6.16 ©Silberschatz, Korth and Sudarshan th Edition Relationship Sets (Cont.) ▪ An attribute can also be associated with a relationship set. ▪ For instance, the advisor relationship set between entity sets instructor and student may have the attribute date which tracks when the student started being associated with the advisor instructor student 76766 Crick Katz Srinivasan Kim Singh Einstein 45565 10101 98345 76543 22222 98988 12345 00128 76543 44553 Tanaka Shankar Zhang Brown Aoi Chavez Peltier 3 May 2008 10 June 2007 12 June 2006 6 June 2009 30 June 2007 31 May 2007 4 May 2006 76653 23121