I have a MySQL database with 3 tables:
- The main table of records called "tracks" (as in music)
- A tags table called "tags"
- A join table for the two called "taggings"
The tags table is basically a list of genres, which is pre-defined. A track can then have 1 or more tags (via the join table).
The idea is, that the user checks off the genres (tags) for which he or she want to find tracks. But I would also like the interface to reflect which tags are no longer "useful", that is, tags which are complementary to the currently selected ones.
Edit: What I missed was that I need to find tags that are complementary to the currently selected set of tags. See my comment below.
Example: the user selects the "rock" and "pop" tags, and is shown a list of tracks that match "rock" + "pop". But suppose there are no tracks in the database that also match "jazz". In that case, I'd like to disable the "jazz" tag in the interface, because "rock" + "pop" + "jazz" would give zero results.
Is there a clever way to do this with MySQL?