桂城网站制作公司,企业年金怎么领取最划算,最大的建材采购平台,仿58网站怎么做sql语句
创建表格 create table 表名 #xff08;字段名 数据类型#xff0c;字段名 数据类型#xff09; create table if not exists 表名 #xff08;字段名 数据类型#xff0c; 字段名 数据类型#xff09; 删除表格 drop table 表名#xff1b;
插入记录 全字…sql语句
创建表格 create table 表名 字段名 数据类型字段名 数据类型 create table if not exists 表名 字段名 数据类型 字段名 数据类型 删除表格 drop table 表名
插入记录 全字段插入 insert into 表名 values 数据 1 数据2 数据 3
部分字段插入 insert into 表名字段名1 字段名2values数据1数据2 查看记录 .header on 打开表头 .mode column 对齐
查看所有记录 select *from 表名
查看某几行 select * from 表名 where 限制条件 逻辑与 and 逻辑或 or 查看某几列 select 字段1字段2 from 表名 select 字段1字段2 from 表名 限制条件
修改记录 updata 表名 set 字段数值 where 限制条件
删除记录 delete from 表名 where 限制条件
主键 primary key
拷贝 从a中拷贝所有数据到b中 create table b as select * from a
从a中拷贝指定字段到b中 create table b as select 字段字段字段from a
增加列 alter table 表名 add colum 字段名 数据类型
修改表名 alter table 旧表名 rename to 新表名 修改字段名列名 将表名重新命名 alter table stuinfo rename to stu;
新建修改名字后的表新建一个a create table stuinfo name char ,age1 int ....
从旧表b中取出数据插入到新表a中 insert into stuinfo select * from stu
删除列 创建一个新表b,并复制旧表a需要保留的字段信息 create table stu as select nameage1sex from stuinfo
删除旧表a drop table stuinfo
修改新表b的名字a alter table stu rename to stuinfo 接口
sqlite3_open
sqlite3_close
sqlite3_errmsg
sqlite3_errcode
sqlite3_exec
sqlite3_get_table
sqlite3_free_table