Take the 2-minute tour ×  I'm looking to set up a blog database
on my website. I'm setting up a MySQL database with a posts
table with the attributes: post_id, datetime, content (all
pretty self-explanatory). I want each post to have tags (which
can be any number of tags). Obviously, this needs a table on its
own, so I made a tags table with attributes: tag_id, tag_name.
Now, to link them I guess I should make a third table, called
post_tag which will define links between posts and tags, so it
will have attributes: post_id, tag_id. I'm sort of new to
database structuring, so I'm wondering if I'm doing this the
right way, or if there is perhaps a more efficient way at
tackling this problem?  Any help is appreciated. Thanks.
share|improve this question add comment  1 Answer  up vote 1
down vote accepted  If posts can have multiple tags you should
have 3 tables:  posts: post_id,postname ........  tags:
tag_id,tag_name  post-tags (linked table) post_id,tag_id  This
may be interested for you: http://databases.abo