title: How to add more tables in a SQLite database
body: <p>I am facing problem in creating more than two tables in SQLite database in android.
  I want to add two more table in my App's SQLite database. 
  When I try to add more tables, it shows an error <strong>Unexpected token.</strong></p>
  
  <p>This is my Database.class</p>
  
  <pre><code>public class DBForms {
  public static final int FORMS = 0 ;
  public static final int ADMITCARDS = 1;
  
  private FormHelper mHelper;
  private SQLiteDatabase mDatabase;
  
  public DBForms (Context context){
      mHelper = new FormHelper(context);
      mDatabase = mHelper.getWritableDatabase();
  }
  
  public void insertForms(int table, ArrayList&lt;FormItem&gt; listForms,boolean clearPrevious){
      if (clearPrevious){
          deleteForms(table);
      }
  
  
      //create a sql prepared statement
      String sql = "INSERT INTO " + (table == FORMS ? FormHelper.TABLE_FORMS : FormHelper.TABLE_ADMITCARDS) + " VALUES (?,?,?,?,?,?,?);";
      //compile the statement and start a transaction
      SQLiteStatement statement = mDatabase.compileStatement(sql);
      mDatabase.beginTransaction();
      for (int i = 0; i &lt; listForms.size(); i++){
          FormItem currentForm = listForms.get(i);
          statement.clearBindings();
          //for a given column index, simply bind the data to be put inside that index
          statement.bindString(2,currentForm.getTitle());
          statement.bindLong(3,currentForm.getLastdate() == null ? -1 : currentForm.getLastdate().getTime());
          statement.bindString(4,currentForm.getCategory());
          statement.bindString(5,currentForm.getDetails());
          statement.bindString(6,currentForm.getProfilePic());
          statement.bindString(7,currentForm.getUrl());
  
          statement.execute();
  
      }
      //set the transaction as successful and end the transaction
      L.m("inserting entries " + listForms.size() + new Date(System.currentTimeMillis()));
      mDatabase.setTransactionSuccessful();
      mDatabase.endTransaction();
  }
  public ArrayList&lt;FormItem&gt; readForms(int table){
      ArrayList&lt;FormItem&gt; listForms = new ArrayList&lt;&gt;();
  
          //get a list of columns to be retrieved, we need all of them
      String[] columns = {FormHelper.COLUMN_UID,
              FormHelper.COLUMN_TITLE,
              FormHelper.COLUMN_LASTDATE,
              FormHelper.COLUMN_CATEGORY,
              FormHelper.COLUMN_DETAILS,
              FormHelper.COLUMN_PROFILEPIC,
              FormHelper.COLUMN_URL,
      };
      Cursor cursor = mDatabase.query((table == FORMS ? FormHelper.TABLE_FORMS : FormHelper.TABLE_ADMITCARDS), columns, null, null, null, null, null);
      if (cursor != null &amp;&amp; cursor.moveToFirst()){
          L.m("loading entries " + cursor.getCount() + new Date(System.currentTimeMillis()));
          do {
              FormItem formItem = new FormItem();
  
              formItem.setTitle(cursor.getString(cursor.getColumnIndex(FormHelper.COLUMN_TITLE)));
              long lastdateMilliseconds = cursor.getLong(cursor.getColumnIndex(FormHelper.COLUMN_LASTDATE));
              formItem.setLastdate(lastdateMilliseconds != -1 ? new Date(lastdateMilliseconds): null);
              formItem.setCategory(cursor.getString(cursor.getColumnIndex(FormHelper.COLUMN_CATEGORY)));
              formItem.setDetails(cursor.getString(cursor.getColumnIndex(FormHelper.COLUMN_DETAILS)));
              formItem.setProfilePic(cursor.getString(cursor.getColumnIndex(FormHelper.COLUMN_PROFILEPIC)));
              formItem.setUrl(cursor.getString(cursor.getColumnIndex(FormHelper.COLUMN_URL)));
  
              listForms.add(formItem);
          }
          while (cursor.moveToNext());
      }
      return listForms;
  }
  
  public  void  deleteForms(int table){
      mDatabase.delete((table == FORMS ? FormHelper.TABLE_FORMS : FormHelper.TABLE_ADMITCARDS), null, null);
  
  }
  private static class FormHelper extends SQLiteOpenHelper {
      public static final String TABLE_ADMITCARDS = "admitcards";
      public static final String TABLE_FORMS = "forms";
      public static final String COLUMN_UID ="id";
      public static final String COLUMN_TITLE ="title";
      public static final String COLUMN_LASTDATE ="lastdate";
      public static final String COLUMN_CATEGORY ="category";
      public static final String COLUMN_DETAILS ="details";
      public static final String COLUMN_PROFILEPIC ="profilePic";
      public static final String COLUMN_URL ="url";
      private static final String CREATE_TABLE_FORM = "CREATE TABLE "+ TABLE_FORMS + " (" +
              COLUMN_UID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
              COLUMN_TITLE + " TEXT," +
              COLUMN_LASTDATE + " INTEGER," +
              COLUMN_CATEGORY + " TEXT," +
              COLUMN_DETAILS + " TEXT," +
              COLUMN_PROFILEPIC+ " TEXT," +
              COLUMN_URL+ " TEXT" +
              ");";
  
      private static final String CREATE_TABLE_ADMITCARDS = "CREATE TABLE "+ TABLE_ADMITCARDS + " (" +
              COLUMN_UID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
              COLUMN_TITLE + " TEXT," +
              COLUMN_LASTDATE + " INTEGER," +
              COLUMN_CATEGORY + " TEXT," +
              COLUMN_DETAILS + " TEXT," +
              COLUMN_PROFILEPIC+ " TEXT," +
              COLUMN_URL+ " TEXT" +
              ");";
  
  
      private static final String DB_NAME = "forms_db";
      private static final int DB_VERSION = 1;
      private Context mContext;
  
  
      public FormHelper(Context context) {
          super(context, DB_NAME, null, DB_VERSION);
          mContext = context;
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          try {
              db.execSQL(CREATE_TABLE_FORM);
              db.execSQL(CREATE_TABLE_ADMITCARDS);
  
              L.m("create table forms executed");
          } catch (SQLiteException exception) {
              L.t(mContext, exception + "");
          }
  
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          try {
             L.m("upgrade table form executed");
              db.execSQL(" DROP TABLE " + TABLE_FORMS + " IF EXISTS;");
              db.execSQL(" DROP TABLE " + TABLE_ADMITCARDS + " IF EXISTS;");
  
              onCreate(db);
          } catch (SQLiteException exception) {
              L.t(mContext, exception + "SQLiteException");
          }
  
       }
    }
  
  }    
  </code></pre>