文档详情

SQLite数据库增删改查操作(国外英文资料).doc

发布:2017-06-09约1.82万字共18页下载文档
文本预览下载声明
SQLite数据库增删改查操作(国外英文资料) One, use the embedded relational SQLite database to store data On the android platform that integrates a embedded relational database SQLite, SQLite3 support NULL, INTEGER, REAL (floating point Numbers), TEXT (string TEXT) and BLOB (binary objects) data type, although only five types of it supports, but in fact SQLite3 also accept a varchar (n), the char (n), a decimal (p, s) data types, such as only preserved in operation or will be converted to the corresponding five types of data. The biggest feature of SQLite is that you can save all kinds of data in any field without worrying about what the data types of field declarations are. For example, you can store a string in a field of type Integer, or store a float in a Boolean field, or store a date value in a character field. But there is one exception: is defined as an INTEGER PRIMARY KEY fields can store 64 - bit INTEGER, when saved to the field data, other than the INTEGER will produce a mistake. In addition, when writing the CREATE TABLE statement, you can omit behind the field name of the data type information, such as the following statements you can omit the name field type information: CREATE TABLE person (personid integer primary key autoincrement, name varchar (20)) SQLite can parse most standard SQL statements, such as: The select * from table name group by group by group. Order by sort clause Such as: Select * from the person Select * from person order by id desc Select name from person group by name having count (*) 1 Pagination SQL is similar to mysql, and the following SQL statement takes five records, skipping the previous three Select * from Account limit 5 offset 3 or select * from Account limit 3, 5 Insert statements: insert into the table name (field list) values (list of values). Insert into person (name, age) values ( think , 3) Update statement: the update table name set field name = value where clause. Update person set name = call where id = 10 Delete statement: delet
显示全部
相似文档