title: Database Design
body: <p>This is a general database question, not related to any particular database or programming language.</p>
  
  <p>I've done some database work before, but it's generally just been whatever works. This time I want to plan for the future.</p>
  
  <p>I have one table that stores a list of spare parts. Name, Part Number, Location etc. I also need to store which device(s) they are applicable too.</p>
  
  <p>One way to do is to create a column for each device in my spare parts table. This is how it's being done in the current database. One concern is if in the future I want to add a new device I have to create a new column, but it makes the programming easier.</p>
  
  <p>My idea is to create a separate Applicability table. It would store the Part ID and Device ID, if a part is applicable to more than one device it would have more than one row.</p>
  
  <pre><code>Parts
  -------
  ID
  Name
  Description
  Etc...
  
  PartsApplicability
  -------
  ID
  PartID
  DeviceID
  
  Devices
  ------
  ID
  Name
  </code></pre>
  
  <p>My questions are whether this is a valid way to do it, would it provide an advantage over the original way, and is there any better ways to do it?</p>
  
  <p>Thanks for any answers.</p>