title: Caused by: android.database.sqlite.SQLiteException: no such column:
body: <p>I have some problem whit my application, because of andorid studio say that a column does not exit. But i declared the column, this is the code:</p>
  
  <pre><code>public class DatabaseCookBookHelper extends SQLiteOpenHelper {
  /* Table Name */
  public static final String TABLE_NAME = "COOKBOOK";
  
  // Table columns
  public static final String _ID = "_id";
  public static final String RECIPE_SUBJECT = "subject";
  public static final String RECIPE_DESC = "description";
  public static final String RECIPE_INGREDIENTS = "ingredients";
  public static final String RECIPE_TIME = "time";
  public static final String RECIPE_RATING = "rating";
  
  // Database Information
  static final String DB_NAME = "COOKBOOK.DB";
  
  // database version
  static final int DB_VERSION = 1;
  
  // Creating table query
  private static final String CREATE_TABLE = "create table " + TABLE_NAME + "(" + _ID
          + " INTEGER PRIMARY KEY AUTOINCREMENT, " + RECIPE_SUBJECT + " TEXT NOT NULL, " + RECIPE_DESC + " TEXT NOT NULL, "
          + RECIPE_INGREDIENTS + " TEXT NOT NULL, " + RECIPE_TIME + " INT NOT NULL, " + RECIPE_RATING + " INT);";
  
  public DatabaseCookBookHelper(Context context) {
      super(context, DB_NAME, null, DB_VERSION);
  }
  
  @Override
  public void onCreate(SQLiteDatabase db) {
      db.execSQL(CREATE_TABLE);
  }
  
  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
      db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
      onCreate(db);
  }
  </code></pre>
  
  <p>and the problem is here. When i do the query the problem appear. The column exist for me, but when i try to execute it the app will break:</p>
  
  <pre><code>public class DBCookbookManager {
  
  private DatabaseCookBookHelper dbHelper;
  
  private Context context;
  
  private SQLiteDatabase database;
  
  public DBCookbookManager(Context c) {
      context = c;
  }
  
  public DBCookbookManager open() throws SQLException {
      dbHelper = new DatabaseCookBookHelper(context);
      database = dbHelper.getWritableDatabase();
      return this;
  }
  
  public void close() {
      dbHelper.close();
  }
  
  public void insert(String name, String desc, String ingredients, String time, String rating) {
      ContentValues contentValue = new ContentValues();
      contentValue.put(DatabaseCookBookHelper.RECIPE_SUBJECT, name);
      contentValue.put(DatabaseCookBookHelper.RECIPE_DESC, desc);
      contentValue.put(DatabaseCookBookHelper.RECIPE_INGREDIENTS, ingredients);
      contentValue.put(DatabaseCookBookHelper.RECIPE_TIME, time);
      contentValue.put(DatabaseCookBookHelper.RECIPE_RATING, rating);
      database.insert(DatabaseCookBookHelper.TABLE_NAME, null, contentValue);
  }
  
  public Cursor fetch() {
      String[] columns = new String[] { DatabaseCookBookHelper._ID, DatabaseCookBookHelper.RECIPE_SUBJECT,
              DatabaseCookBookHelper.RECIPE_DESC, DatabaseCookBookHelper.RECIPE_INGREDIENTS,
              DatabaseCookBookHelper.RECIPE_TIME, DatabaseCookBookHelper.RECIPE_RATING};
      Cursor cursor = database.query(DatabaseCookBookHelper.TABLE_NAME, columns, null, null, null, null, null);
      if (cursor != null) {
          cursor.moveToFirst();
      }
      return cursor;
  }
  
  public int update(long _id, String name, String desc, String ingredients, String time, String rating) {
      ContentValues contentValues = new ContentValues();
      contentValues.put(DatabaseCookBookHelper.RECIPE_SUBJECT, name);
      contentValues.put(DatabaseCookBookHelper.RECIPE_DESC, desc);
      contentValues.put(DatabaseCookBookHelper.RECIPE_INGREDIENTS, ingredients);
      contentValues.put(DatabaseCookBookHelper.RECIPE_TIME, time);
      contentValues.put(DatabaseCookBookHelper.RECIPE_RATING, rating);
      int i = database.update(DatabaseCookBookHelper.TABLE_NAME, contentValues, DatabaseCookBookHelper._ID + " = " + _id, null);
      return i;
  }
  
  public void delete(long _id) {
      database.delete(DatabaseCookBookHelper.TABLE_NAME, DatabaseCookBookHelper._ID + "=" + _id, null);
  }
  </code></pre>
  
  <p>And i don't know where the problem is. I hope in your help, thanks a lot!</p>