multivalued attributes in databases

前端 未结 5 923
甜味超标
甜味超标 2021-02-03 11:47

How should a relational database be designed to handle multi-valued attributes ?

edit: To elaborate:

There are two ways I could think of for do

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-03 12:23

    There are two possible approaches for this -

    1. Relationship : Storing multiple values for one attribute of an entity is done through referenced key-foreign key relationships. For more info, check this.
    2. Set : A scalar datatype in mysql that can have zero or more values, each of which must be chosen from a list of permitted values specified when the table is created. For more info, please check this and this link.

提交回复
热议问题