Assuming you have 3 tables: posts
, tags
, post_tag
. There's an m:n relationship between the posts
and tags
, post_tag
is used to connect them.
How would you count the number of posts that have a particular pair of tags? For instance, counting the number of posts that are tagged with both "news" and "featured"?