Well I run a small video website and on the actual video page there is a strip of "related videos" similar to most video sides (e.g. YouTube) and currently all I'm doing is taking one of its tags randomly and finding other videos with the same tag. Not surprisingly this isn't a great method as some tags are very vague and some videos are mis-tagged.
Example of the current query:
SELECT video_name FROM videos INNER JOIN videotags ON videos.id=videotags.video_id INNER JOIN tags ON tags.id=videotags.tag_id WHERE tag_name='x' AND videos.id<>'y' LIMIT 5
Where x is any one of the tags from the current video and y is the ID from the current video. (P.S. I'm using parameterized queries don't worry)
I'm just curious as to how you all would handle this, maybe it would be better to incorporate similar video titles?
Here is how my database tables are setup:
VIDEOS TABLE
------------
video_id [PK,auto_increment] int(11)
video_name varchar(255)
TAGS TABLE
----------
tag_id [PK,auto_increment] int(11)
tag_name varchar(255)
VIDEOTAGS TABLE
---------------
tag_id [PK,FK] int(11)
video_id [PK,FK] int(11)
There's obviously more columns in the videos table but this just illustrates the simple many-to-many relationship with auto-incrementing primary keys on both sides
The site is built on PHP with a MySQL database, but that really doesn't matter :)
EDIT: There's been some talk of going down an organic route so I figure I'd post my other two tables that are semi-related that are to do with video views and video ratings. Now note I don't have any intention of adding more columns specifically to the video views table because of privacy issues (yes I know I store IPs in the rating table)
VIDEOVIEWS TABLE
----------------
video_id [FK] int(11)
view_time datetime
VIDEORATINGS TABLE
------------------
video_id [PK,FK] int(11)
ip_address [PK] varchar(15)
rating int(1)
rate_time datetime