当前位置: 首页 > news >正文

20250908的学习笔记

一、数据库

1、分类

        大型           ORACLE 

        中型          MYSQL/MSSQL                 

        小型        SQLITE

2、名词

        DB  数据库

        DBMS   数据库管理系统

        MIS   管理信息系统

        OA   办公自动化

3、嵌入式数据库

        Sqlite3 官网:www.sqlite.org

特点:

        1、开源C语言开发。

        2、代码量少1万行左右,总大小10M以内。

        3、绿色软件无需安装。

        4、文件型数据库,可以移动。

        5、数据容量最大2T。

二、sqlite3的基本命令

注:记得创建.db文件

1、系统维护命令

.help        出现所有相关的系统维护命令,都是以 "."开头。

.database        列出当前库和系统中那个文件在关联。

.tables        列出当期数据库中的所有表。

.schema xxx        列出当前指定的xxx表结构。

.dump user(示例)        导出数据库。

补充:

重定向:

        sqlite3 test.db .dump > 123.sql

        sqlite3 xxx.db < test.sql ===>导入数据库

2、标准SQL语句

注:所有的sql语句都以';'结尾。

(1)创建一个表

        create table  表名(表字段1,表字段2,...);

        eg: 

                create table user(id,name,age);

注意:以上表的表字段,支持如下数据类型。int text real blob

  默认是text类型(等同于常说的字符型)。

        create table 表名 (表字段 类型,表字段 类型,。。。。);

        eg:

                create table user(id int  ,name char,age int);

(2)删除一个表

        drop table  表名;

        eg:

                drop table user;

(3)数据库常规操作

①向表中增加数据

        insert into 表名 (字段名称 ) values (值名称);

        eg:

                insert into user (id,age) values (1,10);

                insert into user values(3,"wang",11);

                insert into user (age) values ( 12);

②查询表中的数据

        select 列名 from 表名  条件;

        eg:

                select * from user ;

                select id from user;

                select id,name from user where not  age <30

                where name   like '三一'   % _ 通配符(%代表多个且包括零个任意字符,_代表一个任意字符)

                select *from user order by id(从小到大根据id排序,逆序后加desc) limit 2(只用前2条)

③修改表中数据

        update 表名名 set 表字段 = 值满足条件:

        eg :

                update user set id = 1 where name = 'li';

                update user set id = 1 where name = 'li' and age = 30;

                update user set id = 1 where name = 'li' or age = 30;

④删除表中数据

        delete from 表名 满足条件

        eg:

                delete from user;///删除表中所有数据

                delete from user where id = 1; ///删除id=1 的数据 ;

                delete from user where id =1 and name = "zhang";

                delete from user where id = 1 or id = 2;


文章转载自:

http://FBQ6wLBr.xxwhz.cn
http://MFMmKd90.xxwhz.cn
http://zqLhT7S6.xxwhz.cn
http://GrCCO1am.xxwhz.cn
http://Po6LTANP.xxwhz.cn
http://clDyfSH8.xxwhz.cn
http://hMmhu9DF.xxwhz.cn
http://vbqkyXk6.xxwhz.cn
http://fP38fHod.xxwhz.cn
http://HmIpcK5J.xxwhz.cn
http://nkbmFdYn.xxwhz.cn
http://2nm2LdMV.xxwhz.cn
http://WJFdrdMo.xxwhz.cn
http://wn3aqt8K.xxwhz.cn
http://xxe3wZpY.xxwhz.cn
http://olDe99in.xxwhz.cn
http://8AbUkL8X.xxwhz.cn
http://2FqfeC4y.xxwhz.cn
http://a7tjf2nc.xxwhz.cn
http://SqtELCM5.xxwhz.cn
http://QXSIiB49.xxwhz.cn
http://TyjnUKZX.xxwhz.cn
http://mnNnhZVQ.xxwhz.cn
http://0qZohbiG.xxwhz.cn
http://NUL2NI14.xxwhz.cn
http://XyBGfVAL.xxwhz.cn
http://hEtzNhbs.xxwhz.cn
http://rAWuAFC2.xxwhz.cn
http://jHDesXI0.xxwhz.cn
http://jJ5BO7sc.xxwhz.cn
http://www.dtcms.com/a/372876.html

相关文章:

  • Golang 与 gRPC
  • shareId 的产生与传递链路
  • Go语言实战案例-开发一个JSON格式校验工具
  • AI技术架构与GEO算法原理如何重塑搜索引擎可见性
  • 【AI测试前沿】谷歌Fuzzing安全测试Go语言指南
  • 佰力博检测与您探讨薄膜样品如何测介电常数?
  • jsBridge接入流程
  • TFS-2018《On the convergence of the sparse possibilistic c-means algorithm》
  • ArrayList中的源码解析
  • 详细解析SparkStreaming和Kafka集成的两种方式的区别和优劣
  • 大数据Spark(六十三):RDD-Resilient Distributed Dataset
  • 云原生TodoList Demo 项目,验证云原生核心特性
  • C语言爬虫开发:常见错误与优化方案
  • Linux 应急响应实操 Checklist
  • 【PCIe EP 设备入门学习专栏 -- 8.2.3 Local Bus Controller (LBC) 详细介绍】
  • 将基于 Oracle JDK 17 开发的 Spring Boot 3.2.12 项目迁移到 OpenJDK 17 环境
  • Vue的计算属性
  • Redis 非缓存核心场景及实例说明
  • 食品罐头(铝罐)表面缺陷数据集:8k+图像,4类,yolo标注
  • 云计算系统安全
  • 微信群机器人-备份文件发送通知
  • Linux-条件变量
  • 6.python——字符串
  • 懒汉式——LazyMan(任务队列应用)
  • Nginx 实战系列(四)—— Nginx反向代理与负载均衡实战指南
  • Nginx 反向代理 + Tomcat 集群:负载均衡配置步骤与核心原理
  • 【Linux】匿名管道和进程池
  • PWA:打造媲美 Native Apps 的 Web 应用体验
  • # 小程序 Web 登录流程完整解析
  • 2025中国AI HR市场深度洞察:趋势、厂商与未来展望