SQlite数据库基础之“增删改查”

SQlite数据库基础之“增删改查”


创建一个表:
CRREATE TABLE stu(id Integer,name char,score Integer);
系统命令:
以’.'开头的命令
.help 帮助
.quit 退出
.exit 退出
.schema 查看表的结构图

命令行:
insert into stu values(1001,“zhangsan”,80);
insert into stu (id,name)values(1003,“lisi”);

命令行:
delete from stu where score=‘90’;//删除特定的某些字段

命令行:
update stu set name=“guaishushu” where id=1001;//设置一个字段更改
update stu set name=“guaishushu” ,score = 88 where id=1001;//设置多个字段更改

命令行:
select * from stu;//查询全部
select id from stu;//查询部分字段
select * from stu where score=80;//查询得分80的人
select * from stu where id=1001 and score=80;//查询id为1001且得分80的人

猜你喜欢

转载自blog.csdn.net/guo_xyx/article/details/106608460
今日推荐