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

前端 未结 6 1264
执笔经年
执笔经年 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条回答
  •  悲哀的现实
    2020-12-16 22:36

    Thank you everyone for your very detailed and helpful replies. The bit about using "WHERE tag IN ('tag_1'...'tag_x')" in conjunction with COUNT to select items that match all the tags was exactly what I was missing before.

    The input on using composite primary keys was also really helpful - I felt like there was no point to using a unique ID key on the middle table, but never realised I could use composite keys.

    Thank you once again! You guys are great!

提交回复
热议问题