SQLite 基础6
2023-03-20 15:36:30 时间
创建表
sqlite> create table test ( id int primary key not null, name text );
sqlite> .tables
test
sqlite> .schema test
CREATE TABLE test ( id int primary key not null, name text );
sqlite>
sqlite> insert into test values(1,"hello");
sqlite> insert into test values(2,"hello");
sqlite> insert into test values(3,"hello");
sqlite> select * from test;
1|hello
2|hello
3|hello
sqlite>
Tip: 以点开头的管理命令,如
.tables
和.schema
是不能接;
的,而增删改查类操作是必须要以;
结尾的
sqlite> .table
test
sqlite> .table;
Error: unknown command or invalid arguments: "table;". Enter ".help" for help
sqlite> insert into test values(4,"hello");
sqlite> insert into test values(5,"hello")
...>
...>
...>
...>
...>
...>
...>
...> ;
sqlite> insert into test values(5,"hello")
...>
...>
...>
...>
...>
...>
...> ;
Error: UNIQUE constraint failed: test.id
sqlite>
相关文章
- 技术分享 | MySQL 如何适配 AppArmor
- 新技能GET!在前端表格中花式使用异步函数的奥义
- 量化交易中,如何快速把股票代码转换成Int整形?
- jdbc
- 腾讯云Elasticsearch跨集群复制原理及最佳实践
- 全网最优质的Base64 编码和解码教程,附6个示例!
- sockfwd 一个数据转发的小工具
- 架构解决方案
- Golang中的map数据类型
- Clickhouse 实践
- MySQL技术大全读书笔记:MySQL数据类型【定点数类型】
- Mysql中的join、cross join、inner join是等效的
- 以kafka为代表的拉模式和以RabbitMQ为代表推模式的消息中间件的核心区别
- MySQL的事务实现原理介绍:undo log、redo log、checkpoint和LSN
- mysql查询数据表中记录行数及每行空间占用情况
- MySQL索引原理——B树
- ElasticSearch之index type mapping
- MySQL数据表之间字符集不同连表查询报错
- 数据库分库分表平滑扩容方案
- 学习Flink,看这篇就够了