Skip to main content

ER diagram: product and components

Short answer

Entities: Product (p_no, desc, cost), Component (c_no, desc, measure). Relationships: Product comprised_of Component (M:N), Component has recursive make (assembly, part) with attribute no.

Draw an ER diagram for the following. [The question text is not printed; the page gives only the label and the solution diagram: Product (p_no, desc, cost) is comprised of Component (c_no, desc, measure) in a many-to-many relationship; Component has a recursive relationship 'make' with attribute no.]

The diagram contains two entities, a many-to-many relationship, and a recursive relationship on Component.

Entities and attributes

  • Product (p_no, desc, cost).
  • Component (c_no, desc, measure).

Relationships

  1. comprised_of between Product and Component: M : N. A product is made of many components, and one component can be used in many products.
  2. make on Component (recursive, unary): a component is made from other components. The relationship has the attribute no (how many units of the sub-component are used). Roles: assembly and part.

ER diagram

 (p_no)(desc)(cost)
        \  |  /
       [ Product ]
           |
           M
      <comprised_of>
           |
           N
       [Component]----(c_no)
        |  |   |  \
        |  |   |   (desc)(measure)
        |  |   +---------+
        |  |             |
        1  +----<make>---+  (no)
      (assembly)  N     (part)

The recursive line leaves Component and returns to it, labelled with the roles. In the relational schema this becomes: Product(p_no, desc, cost), Component(c_no, desc, measure), Comprised_of(p_no, c_no), Make(assembly_c_no, part_c_no, no).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Database Management System chapter 2 questions →