SQLite database column doesn't exist
<p>I've looked through several of the questions asked about a column doesn't exist error, and most have either been a spacing issue or an issue relating to a schema, which could be fixed by uninstalling and reinstalling the application. I have proofread my statement and also tried uninstalling the app from my phone and re-downloading it from android studio. Neither seems to have solved my issue.</p>

<p>This line here is throwing the error:</p>

<pre><code>Cursor cursor = db.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE " + DATE_TO_REMIND + "='" + date + "'", null);
</code></pre>

<p>The intention of it is to take each element in the table (with its column counterparts) that has the date that I want (which is a parameter in the method that I have (getWordsToReview). </p>

<p>The error I keep getting is this:</p>

<blockquote>
  <p>Caused by: android.database.sqlite.SQLiteException: no such column: Date_To_Remind (code 1): , while compiling: SELECT * FROM Vocabulary WHERE Date_To_Remind='2016/03/05'</p>
</blockquote>

<p>The rest of this class looks like this:</p>

<pre><code>public class DBHelper extends SQLiteOpenHelper {

    private static final int DATABASE_VERSION = 1;
    private static final String DATABASE_NAME = "vocab.db";
    public static final String VOCAB_INPUT = "Input_Word";
    public static final String VOCAB_TRANSLATION = "Translation";
    public static final String DATE_TO_REMIND = "Date_To_Remind";
    public static final String TABLE_NAME = "Vocabulary";

    public DBHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String query = "CREATE TABLE " + TABLE_NAME + "("
                + VOCAB_INPUT + " TEXT "
                + VOCAB_TRANSLATION + " TEXT "
                + DATE_TO_REMIND + " TEXT"
                + ");";
        db.execSQL(query);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
        onCreate(db);
    }

    public void addWord(Word word) {
        ContentValues values = new ContentValues();
        values.put(VOCAB_INPUT, word.getWord());
        values.put(VOCAB_TRANSLATION, word.getTranslation());
        values.put(DATE_TO_REMIND, word.getDate());
        SQLiteDatabase db = getWritableDatabase();
        db.insert(TABLE_NAME, null, values);
        db.close();
    }

    public void deleteWord(Word word) {
        SQLiteDatabase db = getWritableDatabase();
        db.execSQL("DELETE FROM " + TABLE_NAME + " WHERE " + VOCAB_INPUT + "=\"" + word.getWord() + "\"");
    }

    public List&lt;Word&gt; getWordsToReview(String date) {
        List&lt;Word&gt; returnWords = new ArrayList&lt;&gt;();
        SQLiteDatabase db = getReadableDatabase();
        Cursor cursor = db.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE " + DATE_TO_REMIND + "='" + date + "'", null);
        while (cursor.moveToNext()) {
            String retrievedName = cursor.getString(cursor.getColumnIndex(VOCAB_INPUT));
            String retrievedTranslation = cursor.getString(cursor.getColumnIndex(VOCAB_TRANSLATION));
            String retrievedDate = cursor.getString(cursor.getColumnIndex(DATE_TO_REMIND));
            Word tempWord = new Word(retrievedName, retrievedTranslation, retrievedDate);
            returnWords.add(tempWord);
        }
        cursor.close();
        return returnWords;
    }

    public boolean doesWordExist(Word word) {
        SQLiteDatabase db = getReadableDatabase();
        Cursor cursor = db.rawQuery("SELECT * FROM " + TABLE_NAME + " WHERE " + VOCAB_INPUT + "=\"" + word.getWord() + "\"", null);
        boolean exists = false;
        while (cursor.moveToNext()) {
            String retrievedName = cursor.getString(cursor.getColumnIndex(VOCAB_INPUT));
            if (retrievedName.equalsIgnoreCase(word.getWord())) {
                exists = true;
                break;
            }
        }
        cursor.close();
        return exists;
    }
}
</code></pre>