http://blog.csdn.net/jianxuanlu/article/details/46833393
sql
NSArray *運(yùn)算符 = @[@"=等于",@">大于",@">=",@"<=",@"<>不等于",@"!非"];
/**
*? 實(shí)例A like 'C_'
B like 'B%'
C like '9W[1-3]'
D like '[^1-2]'
通配符使用說(shuō)明:
通常與like關(guān)鍵字一起來(lái)使用
*/
NSArray *通配符 = @[@"_一個(gè)字符",@"%任意長(zhǎng)度的字符串",@"[]括號(hào)中是一個(gè)范圍,表示該范圍內(nèi)的一個(gè)字符",@"[^]不在括號(hào)內(nèi)范圍的一個(gè)字符"];
NSArray *邏輯表達(dá)式 = @[@"AND 邏輯與",@"OR 邏輯或",@"NOT 邏輯非"];
/**
*? sql 語(yǔ)句
*? 創(chuàng)建表示可以指定某列不可以為空
*? spatial 為數(shù)據(jù)庫(kù)名字 person為表名
*/
NSString *創(chuàng)建數(shù)據(jù)庫(kù) = @"create database 'spatial'";
NSString *刪除數(shù)據(jù)庫(kù) = @"drop database 'spatial'";
NSString *創(chuàng)建數(shù)據(jù)表 = @"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 *刪除數(shù)據(jù)表 = @"drop table 'person'";
NSString *插入數(shù)據(jù)行1 = @"insert into 'sspatial'.'person'('ID','Name','Address','Grade','Email','Sex') values(null, 'Peter','武漢', '80', 'Perter@gmail.com','80')";
NSString *插入數(shù)據(jù)行2 = @"insert into person(ID,Name) values('20','Peter')";
NSString *查詢(xún)語(yǔ)句1 = @"select(列名) into <表名> from <源表名>";
NSString *查詢(xún)語(yǔ)句2 = @"select Person.Name, Person.Address into AddressList from Person";
NSString *查詢(xún)語(yǔ)句3 = @"select <列名> from <表名> [where<查詢(xún)條件>] [order by <排序的類(lèi)表>[asc或desc]]";
NSString *查詢(xún)?nèi)?= @"select *from person";
NSString *查詢(xún)部分行 = @"select ID,Name where Address='武漢'";
NSString *數(shù)據(jù)查詢(xún)限制行數(shù) = @"select top 5 Name,Address from person where sex=0";
NSString *數(shù)據(jù)查新返回百分之多少行 = @"select top 20 percent Name from person where sex=0";
NSString *數(shù)據(jù)查詢(xún)升序 = @"select ID, Name from person where(Grage+5)>60 order by Grade";
NSString *數(shù)據(jù)查詢(xún)降序 = @"select Name from person order by ID desc";
NSString *模糊查詢(xún)LIKE = @"select *from 數(shù)據(jù)表 where 編號(hào) like '00[^8]%[A,C]%'";
NSString *模糊查詢(xún)ISNULL = @"selct Name from person Where address is null";
NSString *模糊查詢(xún)特定范圍 = @"select Name from person where grede between 60 and 80";
NSString *更新語(yǔ)句1 = @"update <表名> set <列名 = 更新值> [where<更新條件>]";
NSString *更新語(yǔ)句2 = @"update person set Address='武漢' where Address='河北'";
NSString *更新語(yǔ)句3 = @"update 'spatial'.'person' set 'sex'='1' where 'person'.'ID'=2";
NSString *刪除數(shù)據(jù)行1 = @"delete from <表名> [where<刪除條件>]";
NSString *刪除數(shù)據(jù)行2 = @"delete from Person where Name='Peter limit 1";
coredata
1.coredata第一課政供。最簡(jiǎn)單的使用播聪。http://www.bkjia.com/IOSjc/968547.html? ? || http://www.reibang.com/p/7a1bff293b70(增刪改查)
2.關(guān)系鏈,外健http://www.reibang.com/p/69f55de1f6a9