title: mySQL InnoDB foreign key constraints
body: <p>I've been searching around for quite a while now and can't find a definitive answer.</p>
  
  <p>I have two tables:<br>
  'players' - Store the basic account info for players of a game<br>
  and 'player_stats' - Stores stats of the player</p>
  
  <p>I have a primary key in the 'players' table, and a foreign key in the 'player_stats' table, which references the primary key in the 'players' table.</p>
  
  <p>I want to make it so if I try and delete a record from the stats table, it is denied, and if I delete a record in the players table, their corresponding stats record gets removed. I only seem to be able to do one or the other (on delete cascade on the foreign key allows me to delete a record in the stats table, and 'restrict' denies me from deleting a player.. wrong way round..).</p>
  
  <p>Again: I want it so if I try to delete the PARENT row ('players'), it cascades to the 'player_stats' table, but if I try and delete a row from stats, it's denied.</p>
  
  <p>Thanks.</p>