android 本地数据库实现清空表中数据、删除表

清空表中数据:

private SQLiteHelper mHelper;
mHelper = new SQLiteHelper(this);
SQLiteDatabase db = mHelper.getReadableDatabase();
db.execSQL("delete from sporttable");

删除某张表:

private SQLiteHelper mHelper;
mHelper = new SQLiteHelper(this);
SQLiteDatabase db = mHelper.getReadableDatabase();
db.execSQL("drop table if exists sporttable");

你可能感兴趣的:(sql)