????1. ??????????
????1> SQL???????
????SQL: SQL??Structured Query Language(???????????)????д??SQL????????????????????????? ???????????????????????
????2> ???????????
????MySQL: MySQL??????????SQL???????????? ?????????????????????MySQL ????????????????????á? ????????????????????????????????API????????????????????????????????????????????????????????????
????Oracle??Oracle Database??????Oracle RDBMS??????Oracle??????????????????????????????????????á???÷??????????
????3> ???????????
??????????????洢(???)
?????????????(??????????)
???????о???????????????(????????????????????????????????????)
??????????????(????????????????)
????4> ??????????
????SQLite(http://www.sqlite.org/docs.html)???????????????????? SQLite?????????????????????????????????????????????豸?У?????????K????湻??????????Android??iOS??Window Phone???????????iOS????SQLite??????????libsqlite3.0.tbd???????????sqlite3.h???????ɡ?
????5> ??????
???????????????????????????????????????????????????????????????????????п????????????????

??????Σ????"??"???"???"????????????????????

?????????????????????????????????????????????????

????2. SQL???
????1> SQLite?????????????
????SQLite??????????????????????κ???????????????SQLite???????β???????????????Ч?????????????????????????α???????
????????sqlite?????????????????????sqlite???"???????"?????е?????????????洢???????????????????
????2> SQLite???????????
?????????????????а???"INT"?????????ε?????????INTEGER??
?????????????????а???"CHAR"??"CLOB"??"TEXT"?????????ε?????????TEXT????VARCHAR??
?????????????????а???"BLOB"?????????ε?????????NONE??
?????????????????а???"REAL"??"FLOA"??"DOUB"?????????ε?????????REAL
????????????£???ε?????????NUMERIC

????3> SQLite??????????
????not null(???)??
??????????????????????????????????κ???ο??????
????unique()??
???????????????????????????
????primary key(????)??
???????????(not null)??
???????????(unique)??
???????????????????????????????????????????????????????????(?????????????????????????????)
????foreign key(???)??
??????MySQL?????????????????????????
????????: ???????????????????????????????
????check ???????????????????????????
????default ???????????????????
????autoincrement(????????) ????????????????????????? 1
????4> SQL???
????????????
??????: creat table ????(???1 ???? ???1 ???2?? ???2 ???? ???1?? ...);
????1 -- ????:???????student??????????????????????????; ??????????????????????????????????; ????????'??????'; ???????16
????2
????3 create table if not exists student(s_id integer primary key autoincrement not null?? s_name text default '??????'?? s_age integer check (s_age > 16));
???????????????
??????: insert into ????(???1?? ???2?? ???3?? ...) values(value1?? value2?? value3);
????1 --????:
????2 insert into student(s_name?? s_age) values('ff'?? 18);
????3 insert into student(s_name?? s_age) values('zf'?? 24);
???????????????
??????: update ???? set ?????1 = ????1?? ?????2 = ????2 where ????;
????1 update student set s_age = 18 where s_age = 24;
???????????????
??????: delete from ???? where ????
????1 delete from student where s_age = 2;
??????????????
??????: select ????????? from ???? where ????;
????1 -- * ??????е?????
????2 select * from student;
????3 select * from student where s_age = 18;
????4 select s_name from student where s_age = 24;
????3. iOS???????????????
????1> SQLite???????
????Xcode 6 ?? libsqlite3.0.dylib
????Xcode 7 ?? libsqlite3.0.tdb
????2> ?????????????裺

????3> ??????SQLite
????????<sqlite3.h>????
???????????
???????SQL????????????????
????????????