1. Create a database and open
SQLite db = Openorcreatedatabase ("user.db", mode_private,null);
2. Create a table
Db.execsql ("CREATE TABLE book (_id integer primary key autoincrement,author text,price real,pages integer, Name text)");
3. Inserting data
Sqlitedatabase db = Dbhelper.getwritabledatabase ();
Contentvalues values = new Contentvalues ();
Values.put ("name", "the Da Vinci Code");
Values.put ("Author", "Dan Brown");
Values.put ("pages", 454);
Values.put ("Price", 16.96);
Db.insert ("book", null, values);
Values.clear ();//can store more than one data after emptying
4. Updating data
Values.put ("Author", "Kobe")
Db.update ("book", Values, "_ID>?", New string[]{"3"});
5. Delete data
Db.delete ("book", "PAGES>?", New string[]{"500"});
6. Querying data
Db.rawquery ("SELECT * from book", NULL);
Data type (null: null, Integer: integer value, REAL: Floating-point value, TEXT: String, BLOB: binary)
SQLite Basic Operation