title: Junction table joining multiple tables
body: <p>I have a single table with images which I need to link to 6 other tables. Let's say those tables are - Users, Tables, Foods, Restaurants, Categories, and Ships.</p>
  
  <p>Should I create 6 different junction tables so each table has it's own junction table - Images_Users, Images_Tables, Images_Restaurants etc..?</p>
  
  <p>Or is it better to create one table with a field to distinguish where it links -
  Images_Entity with fields- Id, Image_Id, Entity_Id, Entity_Type(I use this to distinguish whether its a user table, foods, or whatever). I don't like this solution since I will lack FK constraint in this case, but I'm leaning towards since the project will already have a large number of tables.</p>
  
  <p>Perhaps there is a third approach? Create 6 image tables? Which solution is the best performance wise?</p>
  
  <p>EDIT*
  Database will be used to display data, insert, update performance is not an issue, only select statements. I just figured out that no image can link to two entries(This makes the junction tables redundant). </p>
  
  <p>Let me rephrase question entirely- What is the best way to connect Table with only one of the 6 other tables using a one to many association?</p>
  
  <p>So Images table should contain FK and can link to only one of the 6 tables, never two at the same time.</p>