关于SQLite中的函数db.execSQL()?

Ngu*_*yen 1 sqlite android

我是初学者.我学会了SQLite.我不懂函数db.execSQL(DATABASE_CREATE) ;

private static final String DATABASE_CREATE = "create table users (_id integer primary key autoincrement, "  + "name text not null);"; 
Run Code Online (Sandbox Code Playgroud)

功能如此db.execSQL().怎么说的?请帮我.谢谢,

Tyl*_*eat 8

Android SDK文档SQLiteDatabase:

execSQL(String sql): Execute a single SQL statement that is NOT a SELECT or any other SQL statement that returns data.

在您的示例中,要创建表,您将调用db.execSQL(DATABASE_CREATE)哪个将在应用程序的SQLite数据库上执行表create语句.