加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

SQLite数据库简单操作

发布时间:2020-12-12 19:54:41 所属栏目:百科 来源:网络整理
导读:/* SQL 语句 1. 创建一个表 CREATE TABLE 表的名字(字段的名字 类型( text ) 是否是主键 ,... ) eg: CREATE TABLE Students (id integer PRIMARY KEY, name text NOT NULL,0)"> age integer,0)"> sex varchar DEFAULT 男 ) 2. 插入语句 insert into 表的

/*

SQL语句

1.创建一个表

CREATE TABLE 表的名字(字段的名字 类型(text 是否是主键,...

eg:

CREATE TABLE Students (id integer PRIMARY KEY,

name text NOT NULL,0)"> age integer,0)"> sex varchar DEFAULT )

2.插入语句

insert into 表的名字 (字段的名字,... values (内容,...)

insert into students (id,name,age,sex)values(003,'王五',32,'')

3.查询

select *(指定所要查询字段的名字) from 表的名字 where .. order by 字段 desc

01 如果需要添加条件 在表的名字后面 添加where name like '%%'

02&& and || = or

03 对数据进行一个排序 order by 字段 desc(降序)

select * from students

select name from students

select name,id from students

三%'

三%' order by id desc//降序排列[默认升序]

4.修改

update 表的名字 set name = '李四',... where...

5.删除

delete from 表的名字 where...

*/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读