title: MySQL - Duplicate entry for key "PRIMARY"
body: <p>I have the following situation:</p>
  
  <p>In my database, I have a table called <em>Person</em>. A person has an ID. In my conceptual model, student is inherited from person, so I have another table called <em>Student</em>.</p>
  
  <p>I wrote C# code to insert into the <em>Student</em> table:</p>
  
  <pre><code>string query = "INSERT INTO Person (ID, ...) VALUES("id",...);";
  MySqlCommand command = new MySqlCommand(query, connection);
  command.ExecuteNonQuery();
  query = "INSERT INTO Student (..., ID) VALUES(...,"id");";
  command.ExecuteNonQuery();
  </code></pre>
  
  <p>Obviously, I need to add values into the <em>Person</em> class first, because every student is a person. So, after I did that, I try to add the rest of the <em>Student</em> data into the table.</p>
  
  <p>The problem is that I am getting this error:</p>
  
  <blockquote>
    <p>Duplicate entry (id) for key "PRIMARY"</p>
  </blockquote>
  
  <p>which I don't understand, since this key needs to be the same.</p>