Database design - boolean attribute or new table

后端 未结 4 1870
太阳男子
太阳男子 2021-01-20 17:53

Let\'s say I have a database table that I want to filter based on a boolean attribute (for example, \"flagged\" attribute). Is it better to just add a \"flagged\" attribute

4条回答
  •  既然无缘
    2021-01-20 18:48

    If this flag has attributes by itself or if it is reusable, better create it as another table. But if its just something to mark a row as true/false, just make a bool column(and save time and work effort)

提交回复
热议问题