1.下载SQLite安装包
下载后解压
执行sqlite3.exe
2.创建数据库
.open [路径+数据库名字]
【Tips:没有找到指定的数据库文件则会默认创建】
.open ckk.db
3.建表和四个基本的增删改查语句
数据类型常用的有: int 整形、 real 浮点数、text 文本、 blob 二进制
CREATE TABLE student (
stu_id INT(10) NOT NULL PRIMARY KEY,
stu_name VARCHAR(20) DEFAULT NULL,
stu_id_card VARCHAR(18) DEFAULT NULL,
stu_pwd VARCHAR(32) DEFAULT NULL,
stu_mobile VARCHAR(11) DEFAULT NULL,
stu_gender INT(1) DEFAULT NULL,
enrollment_date DATE DEFAULT NULL,
remark VARCHAR(200) DEFAULT NULL,
del_mark INT(1) DEFAULT 1
);
INSERT INTO student(stu_id,stu_name,stu_id_card,stu_pwd,stu_mobile,stu_gender,enrollment_date,remark,del_mark)
VALUES (1,'小明','610123200210202345','pwd123','13500001111',1,'2025-01-05','stu测试',1);
DELETE FROM student WHERE stu_id = 1;
UPDATE student SET stu_name = '蔡坤坤' WHERE stu_id = 1 AND stu_name = '小明';
SELECT * FROM student;
标签:SQLite,建表,DEFAULT,改查,stu,student,VARCHAR,NULL,id
From: https://blog.csdn.net/weixin_45191018/article/details/144948140