multivalued attributes in databases

前端 未结 5 1003
甜味超标
甜味超标 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:48

    Is the relationship one-to-many or many-to-many? With the one-to-many relationship, I recommend a foreign key in the child table (the many) referencing the parent table (the one). With a many-to-many relationship, then your best bet will most probably be a separate table with foreign keys to both parent and child.

提交回复
热议问题