I’m designing a new database where I have two tables, a Users and a Skills table. A user can have many skills. What is best practice for storing multiple skills, a comma delimited skill ids (1,2) or store the skill name (PHP,Ruby)?. Here is simplified version of the database.
Users table:
id int(),
name varcha(),
email varchar(),
skillID varchar()
ID | name | email | skillID |
1 | John Doe | johndoe@domain.com |1,2 |
2 | Jane Doe | janedoe@domain.com |2,3 |
3 | James Smith| jamessmith@domain.com|3,4 |
Skills table:
Id int(),s
skill varchar()
ID | skill |
1 | PHP |
2 | Ruby |
3 | ColdFusion |
4 | ASPX |
How would one retrieve all users with skill ID of 1 and 4. Thank you in advance for your insights.