SQLite
- SQLite is a specific database program which supports SQL.
- Many databases other than SQLite also use the SQL language.
- SQLite is widely available and can be used for small to medium-sized websites.
- Larger websites often use MySQL which uses the same SQL queries listed in this handout, but which requires much greater administrative overhead.
From Baidu:
SQLite,是一款轻型的数据库,是遵守ACID的关系型数据库管理系统,它包含在一个相对小的C库中。它是D.RichardHipp建立的公有领域项目。它的设计目标是嵌入式的,而且目前已经在很多嵌入式产品中使用了它,它占用资源非常的低,在嵌入式设备中,可能只需要几百K的内存就够了。它能够支持Windows/Linux/Unix等等主流的操作系统,同时能够跟很多程序语言相结合,比如 Tcl、C#、PHP、Java等,还有ODBC接口,同样比起Mysql、PostgreSQL这两款开源的世界著名数据库管理系统来讲,它的处理速度比他们都快。
Accessing SQLite
sqlite3 Foo.db
open or createsqlite> .mode column
sqlite> .headers on
formattingsqlite> .quit
sqlite> .help
Creating Table
Searching
skip
Modifying
insert
update
delete
Accessing SQLite in Android
SQLiteDatabase db;
创建实例db = openOrCreateDatabase("MyTestDB",MODE_PRIVATE,null);
创建Table- 用String来插入数据
- Cursor 来making queries