title: Synchronize data in two database table upon deletion
body: <p>This is my school project. I am in chrage of eForum portion. I tried to delete a user and all the threads and replies by the deleted user will also be deleted.</p>
  
  <pre><code>    public boolean deleteUser() {
      boolean success = false;
      DBController db = new DBController();
      db.setUp("IT Innovation Project");
      String sql = "DELETE FROM forumUsers where users_id = " + userID + "";
      if (db.updateRequest(sql) == 1)
          success = true;
      db.terminate();
      return success;
  }
  </code></pre>
  
  <p>This method retrieve the value of the first column of table and stored it as userID. Then, it will execute the delete sql statement to delete certain user.</p>
  
  <pre><code>    public boolean deleteThread() {
      boolean success = false;
      DBController db = new DBController();
      db.setUp("IT Innovation Project");
      String sql = "DELETE FROM forumTopics where topic_id = " + threadID
              + "";
      if (db.updateRequest(sql) == 1)
          success = true;
      db.terminate();
      return success;
  }
  </code></pre>
  
  <p>As for this method, it will take the value of first column of another table which is showing all the threads and execute the delete sql statement.</p>
  
  <p>However, after I deleted some user, the threads and replies by the deleted user is still storing in the database. I am currently using one user table and one thread table in database. Is there any way to like so called 'synchronize' both table? Is it the inner join ?</p>
  
  <p>Thanks in advance.</p>