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

sqlite

发布时间:2020-12-12 23:58:24 所属栏目:百科 来源:网络整理
导读:====9月16 ------创建数据库test dos界面运行 sqlite.exe test.db3 ------创建表courses create table courses ( cno varchar(10) not null, cname varchar(32), credit decimal(2,1) ); ------插入数据 insert into courses (con,cname) values ('01','the

====9月16

------创建数据库test

dos界面运行 sqlite.exe test.db3

------创建表courses

create table courses ( cno varchar(10) not null, cname varchar(32), credit decimal(2,1) );

------插入数据

insert into courses (con,cname) values ('01','the first'),('02','the second');

------删除数据

delete from courses where cno='01';

------查看数据

select * from courses;

------修改数据

update courses set cname='new name' where cno='01';

------strftime

select strftime('%Y',birthday) from students where sname='高平'

------insert

插入一行:

insert into table values('05','e','90');

插入多行:

insert into tablename (select sno,'f',60 from students);(插入了student里面的所有sno)

------delete删除

delete [from] table where sn0='01';

------update修改

update courses set cname='new name' where cno='01';

(编辑:李大同)

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

    推荐文章
      热点阅读