Relationship Sets with Attributes date instructor student D advisor D name name salary tot cred Database System Concepts-7th Edition 6.17 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 6.17 ©Silberschatz, Korth and Sudarshan th Edition Relationship Sets with Attributes
Roles Entity sets of a relationship need not be distinct ·Each occurrence of an entity set plays a“role”in the relationship ■The labels“course_idf'and“prereq_id'are called roles. course course id course id title credits prereq_id prereg Database System Concepts-7th Edition 6.18 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 6.18 ©Silberschatz, Korth and Sudarshan th Edition Roles ▪ Entity sets of a relationship need not be distinct • Each occurrence of an entity set plays a “role” in the relationship ▪ The labels “course_id” and “prereq_id” are called roles
Degree of a Relationship Set Binary relationship involve two entity sets (or degree two). most relationship sets in a database system are binary. Relationships between more than two entity sets are rare.Most relationships are binary.(More on this later.) Example:students work on research projects under the guidance of an instructor. relationship proj_guide is a ternary relationship between instructor, student,and project Database System Concepts-7th Edition 6.19 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 6.19 ©Silberschatz, Korth and Sudarshan th Edition Degree of a Relationship Set ▪ Binary relationship • involve two entity sets (or degree two). • most relationship sets in a database system are binary. ▪ Relationships between more than two entity sets are rare. Most relationships are binary. (More on this later.) • Example: students work on research projects under the guidance of an instructor. • relationship proj_guide is a ternary relationship between instructor, student, and project
Non-binary Relationship Sets Most relationship sets are binary There are occasions when it is more convenient to represent relationships as non-binary. E-R Diagram with a Ternary Relationship project instructor student D proj-guide ID name name salary tot_cred Database System Concepts-7th Edition 6.20 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 6.20 ©Silberschatz, Korth and Sudarshan th Edition Non-binary Relationship Sets ▪ Most relationship sets are binary ▪ There are occasions when it is more convenient to represent relationships as non-binary. ▪ E-R Diagram with a Ternary Relationship
Complex Attributes ■Attribute types: Simple and composite attributes. Single-valued and multivalued attributes Example:multivalued attribute:phone_numbers ·Derived attributes Can be computed from other attributes Example:age,given date_of_birth Domain-the set of permitted values for each attribute Database System Concepts-7th Edition 6.21 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 6.21 ©Silberschatz, Korth and Sudarshan th Edition Complex Attributes ▪ Attribute types: • Simple and composite attributes. • Single-valued and multivalued attributes ▪ Example: multivalued attribute: phone_numbers • Derived attributes ▪ Can be computed from other attributes ▪ Example: age, given date_of_birth ▪ Domain – the set of permitted values for each attribute