I'm creating a database that's going to contain various artists which can be tagged with several tags. It's a standard many-to-may relation and my database looks like this:
artist:
ID
name
tag:
ID
name
tagID:
tagID
artistID
Say I've got two tagIDs, X and Y. What I want to do is to find all the tags that have an artist in common with tag X and Y. How do I do this?
Ultimately what I want this to turn into is an interface that let's you find an artist that's tagged with an arbitrary set of tags. To make the process simpler I want to filter out combinations of tags that will not give any result.