Multiple "categories" to an item?

Good day everyone,

I’m creating an app where I have a “Items” table and a “Categories” table.

Originally, I had a column “itemCategory” within the Items table, so I could filter the items by that category. (e.g: “fruits”, “vegetables”, “meat”, “frozen”, “juices”)

But now, I would like to be able to set several categories to a single item. This resembles the concept of adding “tags” to the items.

The idea is that later I would be able to filter easily all items that meet a set of selected “categories”, so as an example, I could then filter all the “frozen fruits” by selecting the “fruits” and the “frozen” categories.

Also ideally it would be possible for the user to add more “categories” when creating or editing an item.

I’ve seen the column tupe “EnumList”, but I’m not sure if that will be the best solution for later being able to filter easily by one or multiple “categories” (“frozen fruits” or “frozen vegetables”)

1 2 190
2 REPLIES 2

Steve
Platinum 4
Platinum 4

Not sure what the question is.

There is no “best” way. EnumList or a separate table both work. EnumList is easier to implement quickly, but may have drawbacks later depending on how your app behaves.

Based entirely on what you’ve said in this post, my gut says EnumList.

Thank you Steve,

Indeed, it seems that EnumList will do the work nicely.

Top Labels in this Space