title: Why does SQLiteOpenHelper drop the table in "onUpgrade" method?
body: <p>I learned a way which use SQLite3 on Android OS recently.
  But it has a non acceptable part.</p>
  
  <p>I can't understand why drop the table when called "onUpgrade" method of SQLiteOpenHelper.
  Why need "onUpgarde" method?</p>
  
  <p>If code executes "drop table", table data of old version DB will be removed, isn't it?</p>
  
  <p>Why delete existing data of old DB?</p>
  
  <p>How to restore existing DB data when drop the table?</p>
  
  <p><br/>
  [Here is learned code]</p>
  
  <pre><code>public class MySQLiteOpenHelper extends SQLiteOpenHelper {
  
      final String CONFIRMED_SHEETS_TABLE = "confirmed_sheets";
  
      public MySQLiteOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
          super(context, name, factory, version);
      }
  
      @Override
      public void onCreate(SQLiteDatabase sqLiteDatabase) {
          String sql = "create table" +
                  CONFIRMED_SHEETS_TABLE +
                  "_id integer primary key autoincrement, " +
                  "group text, " +
                  "num001 text, " +
                  "num002 text, " +
                  "num003 text, " +
                  "num004 text, " +
                  "num005 text, " +
                  "num006 text, " +
                  "date text)";
          sqLiteDatabase.execSQL(sql);
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {
  
          // non acceptable part //
          String sql = "drop table if exists " + CONFIRMED_SHEETS_TABLE;
          sqLiteDatabase.execSQL(sql);
  
          onCreate(sqLiteDatabase);
      }
  }
  </code></pre>