title: Reset INTEGER PRIMARY KEY AUTOINCREMENT in Android
body: <p>I created a table called DRINK. I inserted two rows in to it initially. When upgraded, I would like to delete both rows and reset my Primary Key to 1. I am getting the rows to delete but am not having any luck resetting the primary key. Does anybody know the syntax on how to do that or if it's even possible? Here's the function which is called from my onUpdate function:</p>
  
  <pre><code>    private void updateMyDatabase(SQLiteDatabase db, int olderVersion, int newVersion){
      Log.v("DatabaseHelper","UPDATE MY DATABASE");
      if (olderVersion&lt;1){
          db.execSQL("CREATE TABLE DRINK (_id INTEGER PRIMARY KEY AUTOINCREMENT,"
                  + "NAME TEXT, "
                  + "DESCRIPTION TEXT, "
                  + "IMAGE_RESOURCE_ID INTEGER);");
          insertDrink(db,"latte","Espresso and Steamed Milk",R.drawable.latte);
          insertDrink(db, "cappuccino", "This a Cappuccino", R.drawable.cap);
      }
      if (olderVersion &lt; 2){
          db.execSQL("delete from DRINK");
          db.execSQL("alter table AUTO_INCREMENT =1"); //*** NEED HELP HERE***
          insertDrink(db, "coff", "Espresso and Steamed Milk", R.drawable.latte);
      }
  }
  </code></pre>
  
  <p>I found this piece of code online but it's not working. Thank you.</p>
  
  <pre><code>db.execSQL("alter table AUTO_INCREMENT =1");
  </code></pre>