title: Android and SQLite: When to use semicolons to end statements?
body: <p>If you are using the <code>rawQuery()</code> or <code>execSQL()</code> methods of SQLite on Android, when should you use a semicolon to end your statement?</p>
  
  <p>On <a href="http://www.vogella.com/articles/AndroidSQLite/article.html" rel="nofollow noreferrer">this tutorial</a>, for instance, the author uses the semicolon on the create table statement (via execSQL), but not on select statement (via rawQuery). For instance:</p>
  
  <p>Create Table Statement:</p>
  
  <pre><code>private static final String DATABASE_CREATE = "create table "
        + TABLE_COMMENTS + "(" + COLUMN_ID
        + " integer primary key autoincrement, " + COLUMN_COMMENT
        + " text not null);";
  database.execSQL(DATABASE_CREATE);
  </code></pre>
  
  <p>Select Statement:</p>
  
  <pre><code>Cursor cursor = getReadableDatabase().
    rawQuery("select * from todo where _id = ?", new String[] { id });
  </code></pre>
  
  <p>Is it the case that statements using the <code>execSQL()</code> method need a semicolon at the end, but statements using the <code>rawQuery()</code> method don't?</p>