Databases · Middle · Question 58 of 75
How should tags on articles usually be stored in a relational database?
- ✓Correct answer: A
tagstable and anarticle_tags(article_id, tag_id)junction table (or atext[]with a GIN index for simple cases) - 2A comma-separated string in the articles table
- 3A separate column for each possible tag
Explanation
The junction table supports renaming tags, counting usage and foreign keys. Arrays are simpler when tags are just labels without their own data.