0

I'm talking about database diagrams. i need to convert an ER diagram into a relational scheme. I noticed that a multivalued attribute is an ID of another entity.

To be specific, there are two entities. a WORKSTATION and a COMPUTER UNIT. the WORKSTATION has a multivalued attribute "unit". its values are the ID of COMPUTER UNIT. how should i transform that into relational?

From what I know, a new relation is created for multivalued attribute. the relation will have attributes for the ID of the workstation and ID of the unit. in that case, the values of the "unit" attribute will point to the ID of COMPUTER UNIT then it will be a relation that represents a many-to-many relationship. but a COMPUTER UNIT only has 1 WORKSTATION while a workstation can have multiple COMPUTER UNIT.

Dylan
  • 13
  • 1
  • 3
  • Just make `unit` the PK of the new relation, instead of a composite key of both attributes. – reaanb Apr 18 '17 at 06:26
  • then what would become of the workstation ID? thanks! – Dylan Apr 18 '17 at 06:34
  • It would be a dependent attribute: `(unit PK, workstation ID)`. Each unit can only appear once in the new relation, so it can only be associated with a single workstation ID. – reaanb Apr 18 '17 at 07:22
  • but then the workstation ID will point to a unique workstation entity. which will make it many to many relationship? im sorry if im not getting what youre trying to say. – Dylan Apr 18 '17 at 07:42
  • A many-to-many relationship would be `(unit PK, workstation_ID PK)`. If only the `unit` is included in the primary key, it's a many-to-one relationship from unit to workstation. – reaanb Apr 18 '17 at 09:47
  • See my answer here: http://stackoverflow.com/questions/42712751/whats-the-relationship-between-the-two-entities/42714033#42714033 – reaanb Apr 18 '17 at 09:54

0 Answers0