title: MySQL how to set a column to reference columns from another table
body: <p>I want to define the value of columnA in tableA to have the count of all rows in tableB where tableB.columnB</p>
  
  <p>I have two tables:</p>
  
  <pre><code>articles table
  columns: articleId,numComments
  comments table
  columns: articleId,content
  </code></pre>
  
  <p>I want numComments column in table "articles" to contain a count of all rows in table comments where <code>articles.articleId=comments.articleId</code></p>
  
  <p>Do I need to set any one of them as "innodb"?</p>