当前位置:网站首页>sqlite数据库的系统表sqlite_master
sqlite数据库的系统表sqlite_master
2022-06-26 18:07:00 【yanruo06280】
sqlite数据库的系统表sqlite_master
1、概述
每一个sqlite数据库都有一个叫sqlite_master的表,用来定义数据库的模式。此表中记录着这个数据库中的所有表的信息,比如表的名称、用于创建此表的sql语句、索引、索引所属的表、创建索引的sql语句等。
2、表结构如下:
字段 name 是所有表的名字,而且对于自己创建的表而言,字段 type 永远是 ‘table’
create table sqlite_master(
type text,
name text,
tbl_name text,
rootpage intger,
sql text
);
3、常用应用场景
①查询表信息
select * from sqlite_master
where type=’table’ and name=‘表名’;
②查询索引信息
如果要查询索引信息,则type字段为“index”,name字段为索引名称,返回结果中的tbl_name字段为该索引所属的表,sql字段为创建此索引的sql语句
select * from sqlite_master where type=’index’ and name=‘索引名’;
参照:https://blog.csdn.net/jingcheng345413/article/details/70155254
边栏推荐
猜你喜欢

Connected to surface test questions

No manual prior is required! HKU & Tongji & lunarai & Kuangshi proposed self supervised visual representation learning based on semantic grouping, which significantly improved the tasks of target dete

决策树与随机森林

CD-CompactDisk
![[code Capriccio - dynamic planning] t583. Deleting two strings](/img/01/fd9ff51ea1d70188e372e925d8a1c7.png)
[code Capriccio - dynamic planning] t583. Deleting two strings
![[buuctf.reverse] 126-130](/img/df/e35633d85caeff1dece62a66cb7804.png)
[buuctf.reverse] 126-130

Vscode usage - Remote SSH configuration description

深入理解MySQL锁与事务隔离级别

Class inheritance of 25class

properties文件乱码
随机推荐
transforms.RandomCrop()的输入只能是PIL image 不能是tensor
清华&商汤&上海AI&CUHK提出Siamese Image Modeling,兼具linear probing和密集预测性能!
MySQL的MVCC机制详解
二分查找-2
深层次安全定义剖析及加密技术
输入n个整数,输出出现次数大于等于数组长度一半的数
pycharm的plt.show()如何保持不关闭
JS 常用正则表达式
你好,现在网上股票开户买股票安全吗?
让torch.cuda.is_available()从false变成true的一点经验
Number of solutions for knapsack problem
#26class中get和set设置
map和filter方法对于稀缺数组的处理
Hello, is it safe to open an online stock account and buy stocks now?
Bayesian network explanation
Case study of row lock and isolation level
next(iter(dataloader))的一点点体会
17.13 补充知识、线程池浅谈、数量谈、总结
JNI的 静态注册与动态注册
DoS及攻击方法详解