How does an app like del.icio.us add tags to urls. They must have two tables in a database, tags and urls, but how do they associate tags with urls and visa versa?
Could be with a third table, a lookup table: Table Tags: ID - Tag Name 1 - Apple 2 - Digital Point Table URLS: ID - URL 1 - http://www.microsoft.com 2 - http://www.apple.com 3 - http://forums.digitalpoint.com 4 - http://www.digitalpoint.com/tools/ Table Lookup: Tag ID - URL ID 1 - 2 2 - 3 2 - 4 Now if they want to display all the Digital Point tagged URLs: SELECT url FROM table_urls LEFT JOIN table_lookup ON table_urls.id = table_lookup.url_id LEFT JOIN table_tags ON table_lookup.tag_id = table_tags.id WHERE table_tags.name = 'Digital Point'; Result: http://forums.digitalpoint.com http://www.digitalpoint.com/tools/