Will this (normalised) database structure permit me to search by tags as I intend?

前端 未结 6 1253
执笔经年
执笔经年 2020-12-16 22:24

I am trying to set up a normalised MySQL database containing the three following tables. The first table contains a list of items which can be described by various tags. T

6条回答
  •  萌比男神i
    2020-12-16 22:53

    Not sure others might have already mentioned this but the id column in the second table is redundant. You can just create a join primary key:

    PRIMARY KEY (item_id, tag_id)
    

    Otherwise, it's a bretty standard m:n database scheme and it should work alright.

提交回复
热议问题