Many-to-many relationship: use associative table or delimited values in a column?

后端 未结 9 1821
孤街浪徒
孤街浪徒 2020-12-16 13:48

Update 2009.04.24

The main point of my question is not developer confusion and what to do about it.

The point is to understand when delimite

9条回答
  •  一向
    一向 (楼主)
    2020-12-16 14:12

    The Document_Category table in your design is certainly the correct way to approach the problem. If it's possible, I would suggest that you educate the developers instead of coming up with a suboptimal solution (and taking a performance hit, and not having referential integrity).

    Your other options may depend on the database you're using. For example, in SQL Server you can have an XML column that would allow you to store your array in a pre-defined schema and then do joins based on the contents of that field. Other database systems may have something similar.

提交回复
热议问题