How do I check in SQLite whether a table exists?

We can check the table exists or not by execute simple query

private boolean isTableExists(SQLiteDatabase db, String table){
   String sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='"+tableName+"'";
   Cursor mCursor = db.rawQuery(sql, null);
   if (mCursor.getCount() > 0) {
      return true;
   return false;


Just pass your table name in the above and you will find table exists or not


Flutter Questions

Android Questions

Python Questions

Java Questions