调试环境:
ubuntu 16.04
Android sdk 7.1.1 / platform-tools sqlite3
(1)创建数据库文件
无需手动创建db文件,直接在命令行执行:
~/test_sqlite$ sqlite3 test.db
进入SQLIte命令行,直接使用标准SQL建表:
sqlite> create table test_table (id integer primary key, name text, description text);
sqlite> .exit
看到对应目录下,db文件“test.db”已经被自动创建。再打开,检查一下刚刚创建的表:
~/test_sqlite$ sqlite3 test.db
SQLite version 3.9.2 2015-11-02 18:31:45
Enter ".help" for usage hints.
sqlite> .tables
test_table
当然,还可以用schema命令查看一下更详细的信息:
sqlite> .schema test_table
CREATE TABLE test_table (id integer primary key, name text,