Any suggestions for a db schema for storing related keywords?
I have to store a set of related keywords inside a database. As of now, I am thinking of using the following: To store the keywords themselves: CREATE TABLE keywords( id int(11) AUTO_INCREMENT PRIMARY KEY, word VARCHAR(255) ); To store the relations (stores the ids of the related keywords): CREATE TABLE relatedkeywords( id int(11) AUTO_INCREMENT PRIMARY KEY, keyword1 int(11), keyword2 int(11), FOREIGN KEY (keyword1) REFERENCES keywords(id), FOREIGN KEY (keyword2) REFERENCES keywords(id) ); Is this the convention or is there a better way of doing this? The only problem I am seeing is that I