sqlite3_exec ——|1.创建表 create table 表名(列名,类型,.....);
——|2. 插入数据 insert into 表名 values(‘王’,1,20);
——|3.修改 update 表名 set name = ‘王’ where name = ‘李’;
——|4.删除 delete from 表名 where number = 3 ;
5. 查找 select *from 表名 where age = 20; (整行查找)
主键 primaryKey (独一无二的)
数据库
1. 以⼀定⽅方式储存在⼀一起;
2. 能为多个⽤用户共享;
3. 具有尽可能⼩小得冗余度;
4. 与程序彼此独立的数据集合;
沙盒机制
通过代码查找程序沙盒相对路径
NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory,NSSearchPathDomainMask domainMask,BOOL expandTilde);
. app (NSBundle) 包
NSDocumentDirectory————>Documents⽂文件夹
NSTemporaryDirectory()———>tmp⽂文件夹
NSLibraryDirectory—————>Library⽂文件夹————>{1.cache,2.pre}