I have 3 tables which allows me to get all tags of some picture, or all pictures with a specific tag.
I would like also to know the number of times each tag exist. How could I get this info using MySQL ?
Is it worth to add a "Count" column to the Tags
table to hold this info ?
Files Table
File ID File Name ...
------- ---------
1 a.jpg ...
2 b.png ...
3 c.jpg ...
. .
. .
. .
Tags Table
Tag Name Tag Creator ...
-------- -----------
David david ...
2010 julia ...
. .
. .
. .
FilesTags Table
File ID Tag Name
------- --------
1 2010
1 April
1 David
2 2010
2 Julia
3 Friends
. .
. .
. .