220k views
3 votes
6.What is a recursive relationship? Give an example.'

8. Discuss the difference between a composite key and a composite attribute. How would each be indicated in an ERD?

9. What two courses of action are available to a designer who encounters a multivalued attribute?

1 Answer

6 votes

Final answer:

A recursive relationship is an entity related to itself, like an employee to their supervisor in the same firm. A composite key is a unique combination of attributes, while a composite attribute includes multiple sub-attributes. To handle multivalued attributes, designers can create a new entity or, less ideally, use repeating groups.

Step-by-step explanation:

A recursive relationship in database design is a relationship between an entity and itself. For example, in an organizational chart, an employee might have a supervisor who is also an employee; hence, the Employee entity has a recursive relationship to itself, representing the reporting structure within the organization.

The difference between a composite key and a composite attribute is significant in database design. A composite key is made up of two or more attributes that uniquely identify an entity instance in a table. For example, in a table where both the course_id and student_id together define a unique enrollment, they would form a composite key. On the other hand, a composite attribute is an attribute made up of multiple sub-attributes, but it is not necessarily unique. In an ERD, a composite key would be indicated by underlining the key attributes forming the composite key, whereas composite attributes would be represented as an attribute with sub-attributes branching off from it.

If a designer encounters a multivalued attribute, they have a couple of courses of action. They could create a new entity to represent instances of the multivalued attribute, thus ensuring that each instance relates back to the original entity with a foreign key. Alternatively, they could implement a repeating group if the database system allows this, though it is generally not normalized and is discouraged.

User Jason Byrne
by
8.2k points