sqlite3数据库基本使用

行云流水
2022-12-07 / 0 评论 / 72 阅读 / 正在检测是否收录...

基本命令

# 打开
sqlite3 mm.db

# 当前数据库
.database

# 所有表
.tables

# 表结构
.schema items

# 表索引
.indices items

# 删除表
drop table option;

# 查询数据
select * from items;

数据导入导出

# 导出
.output items.csv
.separator ,
select * from items;

# 建表
CREATE TABLE "items" (
  "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
  "cat" integer NOT NULL,
  "itemId" integer NOT NULL,
  "count" integer NOT NULL
);

# 导入
.import items.csv items

评论 (0)

取消
只有登录/注册用户才可评论