title: Why do I need to use foreign key if I can use WHERE?
body: <p>A beginners' question about foreign key in MySQL.</p>
  
  <p>In <a href="http://www.w3schools.com/Sql/sql_foreignkey.asp" rel="noreferrer">w3school</a> it says, </p>
  
  <blockquote>
    <p>A FOREIGN KEY in one table points to a PRIMARY KEY in another table.</p>
  </blockquote>
  
  <p>And also there is WHERE,</p>
  
  <pre><code>WHERE id = page_id
  </code></pre>
  
  <p>So if I can use WHERE for linking the tables, what is the main purpose of having foreign key?</p>