码迷,mamicode.com
首页 > 移动开发 > 详细

ios开发之数据库FMDB

时间:2015-04-03 13:25:23      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:

 

 

选择以下按钮进行编辑

 技术分享

数据库的创建

create table if not exists StudentInfo(sid integer,username vachar(20),password vachar(20),scare vachar(20))

 

插入

insert into StudentInfo(sid,username,password,score)

values(1501,‘zhangsan‘,‘123‘,‘100’)

 

查询

select "from StudentInfo”;

查询指定字段

select username from StudentInfo;

查询指定条件的信息

select *from StudentInfo where username=‘zhangsan’

根据指定多个条件查询

select *from StudentInfo where username=‘zhangsan‘ and password=‘123‘

默认升序排序

select *from StudentInfo order by score

降序排序

select *from StudentInfo order by score desc

统计行数

select count(*)from StudentInfo

修改数据

update StudentInfo set score=‘100‘ where username=‘zhangsan’;

删除数据

delete from StudentInfo where sid=‘1502‘

 

ios开发之数据库FMDB

标签:

原文地址:http://www.cnblogs.com/xjia/p/4389609.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!