title: How to create a two table in single Database in Android Application?
body: <p>I have Created a database in Sqllite Android Application and I tried to add two tables in my Database, but I have problem to create that Database. First Table only Created. Can anyBody help me?</p>
  
  <pre><code>    package com.android.cdtech;
  
      import java.sql.SQLException;
  
      import android.content.ContentValues;
    import android.content.Context;
  import android.database.Cursor;
   import android.database.sqlite.SQLiteDatabase;
    import android.database.sqlite.SQLiteOpenHelper;
    import android.util.Log;
  
    public class saveData {
   public static final String KEY_ROWID = "rowid"; public static final String KEY_DATE = "Date";public static final String KEY_NAME = "CustomerName";public static final String KEY_AMOUNT = "Amount";public static final String KEY_BANK = "Banks";
   private static final String TAG = "DBAdapter";
   public static final String KEY_BUSNAME="BusinessName";public static final String KEY_ADD="Address";public static final String KEY_CPERSON="ContactPerson";;
   private static final String DATABASE_NAME = "EXPORTDETAILS";
   private static final String DATABASE_TABLE = "Payment";
   private static final String DATABASE_TABLE2 = "Customer";
   private static final int DATABASE_VERSION = 1;
   private static  String DATABASE_CREATE =
  "create table Payment (_id integer primary key autoincrement, "
  + "Date text not null,"+"CustomerName text not null,"+"Amount text not null,"+"Banks text not null);";  
  
   private static final String DATABASE_CREATECUS =
              "create table Customer (_id integer primary key autoincrement, "
              + "BusinessName text not null,"+"Address text not null,"+"ContactPerson text not null,"+"PhoneNumber text not null,);";
   private final Context context;  
   private DatabaseHelper DBHelper;
   private SQLiteDatabase db;
  
  
  
      public saveData(Context ctx) 
      {
          this.context = ctx;
          DBHelper = new DatabaseHelper(context);
      }
      private static class DatabaseHelper extends SQLiteOpenHelper 
      {
          DatabaseHelper(Context context) 
          {
              super(context, DATABASE_NAME, null, DATABASE_VERSION);
          }
  
          @Override
          public void onCreate(SQLiteDatabase db) 
          {
              db.execSQL(DATABASE_CREATE);
              db.execSQL(DATABASE_CREATECUS);
          }
  
          @Override
          public void onUpgrade(SQLiteDatabase db, int oldVersion, 
                                int newVersion) 
          {
              Log.w(TAG, "Upgrading database from version " + oldVersion 
                    + " to "
                    + newVersion + ", which will destroy all old data");
              db.execSQL("DROP TABLE IF EXISTS titles");
              onCreate(db);
          }
      }    
  public saveData open()throws SQLException
  {
      db=DBHelper.getWritableDatabase();
      return this;
  }
  public void close()
  {
      DBHelper.close();
  }
  
      public long insert(String Date,String CustomerName,String Amount,String Banks) {
      // TODO Auto-generated method stub
       ContentValues cv=new ContentValues();
       cv.put(KEY_DATE,Date);
       cv.put(KEY_NAME,CustomerName);
       cv.put(KEY_AMOUNT,Amount);
       cv.put(KEY_BANK,Banks);
       return db.insert(DATABASE_TABLE, null,cv);
  }   
      public long insertForm(String BusinessName ,String Address ,String ContactPerson) {
          // TODO Auto-generated method stub
           ContentValues cv=new ContentValues();
           cv.put(KEY_BUSNAME,BusinessName);
           cv.put(KEY_ADD,Address);
           cv.put(KEY_CPERSON,ContactPerson);
      }
      public Cursor getlatlng()
       {
          Cursor latlngCursor = db.rawQuery("select * from " + DATABASE_TABLE,null);
           if (latlngCursor != null) 
           {
               latlngCursor.moveToFirst();
           }
           db.close();
          return latlngCursor;
       }
      public Cursor order()
       {
          Cursor latlngCursor = db.rawQuery("select * from " + DATABASE_TABLE2,null);
           if (latlngCursor != null) 
           {
               latlngCursor.moveToFirst();
           }
           db.close();
          return latlngCursor;
       }
  }
  </code></pre>
  
  <blockquote>
    <p><strong>Error Code =1 No Such table for Customer</strong></p>
  </blockquote>