Sqlite   发布时间:2022-05-22  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了SQLite数据库在终端的常用命令总结大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

学了sqlite数据库

打开sqlite数据库 如果没有的话创建:

sqlite3 per.db;//打开sqlite数据库:

1.

.tables查看里面是否内容;

2.

create table file(表名)(ID int,name varchar,agE int);//创建

3.

insert into file (ID,name,age) values(1,‘小明’,18)//file里插入内容;。

4.

.SELEct *from per.db//查询file里的内容 *表示所有的字段;

.Help //显示所有信息

5.

.open file.db 回车 .database 回车 //获取file路径

6.

update file set name =‘张明’ where ID =1; //where 表示条件,当ID=1时;

7.

create table student (id integer,priMary key auto increment,name varchar);//设置主键,只能有一个,不能重复,

设置值

insert into student(name)values(’小明’)//结果:1|小明;

insert into student(name)values(’小明’)//结果:

1|小明

2|小明;

insert into student(ID,name)values(10,’小明’)//结果:

1|小明

2|小明;

10|小明;

8.更新 某个表里的字段

update student set name=‘张明’ where ID=1;

//结果:1|张明

9.删除 记录

delete *from student where ID=2 //只是把表的记录删了

10.删除 student 这个表

drop table student

11.

SELEct name from student //只输出 student的name值

大佬总结

以上是大佬教程为你收集整理的SQLite数据库在终端的常用命令总结全部内容,希望文章能够帮你解决SQLite数据库在终端的常用命令总结所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。