http://blog.csdn.net/jianxuanlu/article/details/46833393
sql
NSArray *运算符 = @[@"=等于",@">大于",@">=",@"<=",@"<>不等于",@"!非"];
/**
* 实例A like 'C_'
B like 'B%'
C like '9W[1-3]'
D like '[^1-2]'
通配符使用说明:
通常与like关键字一起来使用
*/
NSArray *通配符 = @[@"_一个字符",@"%任意长度的字符串",@"[]括号中是一个范围,表示该范围内的一个字符",@"[^]不在括号内范围的一个字符"];
NSArray *逻辑表达式 = @[@"AND 逻辑与",@"OR 逻辑或",@"NOT 逻辑非"];
/**
* sql 语句
* 创建表示可以指定某列不可以为空
* spatial 为数据库名字 person为表名
*/
NSString *创建数据库 = @"create database 'spatial'";
NSString *删除数据库 = @"drop database 'spatial'";
NSString *创建数据表 = @"create table 'person'('ID' int not null auto_increment primary key,'Name' varchar(20) not null, 'Crade' varchar(100) null, 'Email' varchar(100), 'Sex' BOOL null))";
NSString *删除数据表 = @"drop table 'person'";
NSString *插入数据行1 = @"insert into 'sspatial'.'person'('ID','Name','Address','Grade','Email','Sex') values(null, 'Peter','武汉', '80', 'Perter@gmail.com','80')";
NSString *插入数据行2 = @"insert into person(ID,Name) values('20','Peter')";
NSString *查询语句1 = @"select(列名) into <表名> from <源表名>";
NSString *查询语句2 = @"select Person.Name, Person.Address into AddressList from Person";
NSString *查询语句3 = @"select <列名> from <表名> [where<查询条件>] [order by <排序的类表>[asc或desc]]";
NSString *查询全部 = @"select *from person";
NSString *查询部分行 = @"select ID,Name where Address='武汉'";
NSString *数据查询限制行数 = @"select top 5 Name,Address from person where sex=0";
NSString *数据查新返回百分之多少行 = @"select top 20 percent Name from person where sex=0";
NSString *数据查询升序 = @"select ID, Name from person where(Grage+5)>60 order by Grade";
NSString *数据查询降序 = @"select Name from person order by ID desc";
NSString *模糊查询LIKE = @"select *from 数据表 where 编号 like '00[^8]%[A,C]%'";
NSString *模糊查询ISNULL = @"selct Name from person Where address is null";
NSString *模糊查询特定范围 = @"select Name from person where grede between 60 and 80";
NSString *更新语句1 = @"update <表名> set <列名 = 更新值> [where<更新条件>]";
NSString *更新语句2 = @"update person set Address='武汉' where Address='河北'";
NSString *更新语句3 = @"update 'spatial'.'person' set 'sex'='1' where 'person'.'ID'=2";
NSString *删除数据行1 = @"delete from <表名> [where<删除条件>]";
NSString *删除数据行2 = @"delete from Person where Name='Peter limit 1";
coredata
1.coredata第一课。最简单的使用。http://www.bkjia.com/IOSjc/968547.html || http://www.jianshu.com/p/7a1bff293b70(增删改查)
2.关系链,外健http://www.jianshu.com/p/69f55de1f6a9