title: Can a foreign key reference multiple tables?
body: <p>So I'm doing a bit of practise in database design, and a question arose that I couldn't figure out how to correct.</p>
  
  <p>I'm pretty new at this, so I'm not the best but here it goes.</p>
  
  <p>So I want to create two different tables, one called Team, and one called Player. These tables are pretty different from one another.</p>
  
  <p>I then want another table called Challenge, which I want to reference either Team or Player.</p>
  
  <p>Basically there are competitions, and they are either competed individually, or as a team. I want a foreign key to reference Team, if its a team challenge, or Player if its individual.</p>
  
  <p>I can't combine the two tables, as they contain very different elements.</p>
  
  <p>Im just a bit confused as to how to do it. Can I have just one foreign key, that will reference one table or another. Or shall I have two, with one null. </p>
  
  <p>Or can I add another ID key in the Team and Player. And then in Challenge if a new Type key indicated its a group, it'll reference Team, and if its individual, it references Player.</p>
  
  <p>Again, pretty new at this, so hope I made sense.</p>