I’m going to make a website to post with tags. Tags can be up to five number of tags like at stackoverflow.com.
Can anyone tell the tag system of StackOverflow? The relational database system with post and tag.
Should I add a column in post table or should I create separate tag table for it? Tags can be separated by spaces or comma.
Definitely create a table containin the list of available tags.
You should also definitely create a separate applied tag table containing:
showing the order.
added the tag or when it was added.
You want to use a normalized design because using an denormalized design (adding 5 columns) will break if you ever want to change your business rules to allow fewer or more tags. Also, it doesn’t help you if you have other information to keep, such as when the tag was added and by whom.
EDIT: DDL
At the OP’s request: