From 5cc0605aaf5351489c7932faf3091b280fb2e338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E9=B9=8A=E6=9D=83?= <1773509020@qq.com> Date: Tue, 3 Sep 2024 17:03:44 +0800 Subject: [PATCH 1/7] test --- ...46\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\350\213\217\351\271\212\346\235\203/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" diff --git "a/\350\213\217\351\271\212\346\235\203/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" "b/\350\213\217\351\271\212\346\235\203/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" new file mode 100644 index 0000000..e69de29 -- Gitee From acc42c4794b5c44e2806514c16ae060d17e5c878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E9=B9=8A=E6=9D=83?= <1773509020@qq.com> Date: Sat, 7 Sep 2024 15:56:53 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 苏鹊权 <1773509020@qq.com> --- ...56\345\272\223\350\256\276\350\256\241.md" | 117 ++++++++++++++++++ ...12\344\274\240\345\233\276\345\272\212.md" | 68 ++++++++++ 2 files changed, 185 insertions(+) create mode 100644 "20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" create mode 100644 "20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" diff --git "a/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" "b/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" new file mode 100644 index 0000000..3ffe5c1 --- /dev/null +++ "b/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" @@ -0,0 +1,117 @@ +# 笔记: + +# 1.表之间表关系 + +## 1.一对一:A表之中的数据,在B表中只能找到一条数据关 联,反之亦然。 + +## 2.一对多:A表中的数据,在B表能找到多条数据关联。 + +## 3.多对多:A表中的数据,在B表能找到多条数据关联。反之亦然。 + +## 2.数据库设计三大范式 + +## 1. 第一范式:确保每个表格中的字段都包含原子值,即每个字段只能存储一个单一的值,不允许出现重复的组。 + +## 2.第二范式:确保每个非主属性完全依赖于主键,而不是主键的一部分。解决了部分依赖的问题。 + +## 3.第三范式:确保每个非主属性既不依赖于主键的部分,也不依赖于其他非主属性(消除传递依赖)。 + + + +# powerdesigner: + + + +![概念模型](https://gitee.com/xiao-suqq/image-bed-img/raw/master/img/%E6%A6%82%E5%BF%B5%E6%A8%A1%E5%9E%8B.png) + + + +![](https://gitee.com/xiao-suqq/image-bed-img/raw/master/img/%E7%89%A9%E7%90%86%E6%A8%A1%E5%9E%8B.png) + + + +![逻辑模型](https://gitee.com/xiao-suqq/image-bed-img/raw/master/img/%E9%80%BB%E8%BE%91%E6%A8%A1%E5%9E%8B.png) + +# SQL文件: + +```sql +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2024/9/4 21:49:22 */ +/*==============================================================*/ + + +drop table if exists actor; + +drop table if exists canyan; + +drop table if exists director; + +drop table if exists movie; + +drop table if exists pinfen; + +/*==============================================================*/ +/* Table: actor */ +/*==============================================================*/ +create table actor +( + aid int not null, + aname varchar(255), + primary key (aid) +); + +/*==============================================================*/ +/* Table: canyan */ +/*==============================================================*/ +create table canyan +( + aid int not null, + did int not null, + primary key (aid, did) +); + +/*==============================================================*/ +/* Table: director */ +/*==============================================================*/ +create table director +( + did int not null, + dname varchar(255), + primary key (did) +); + +/*==============================================================*/ +/* Table: movie */ +/*==============================================================*/ +create table movie +( + mid int not null, + number float(3) not null, + did int not null, + mname varchar(255), + primary key (mid) +); + +/*==============================================================*/ +/* Table: pinfen */ +/*==============================================================*/ +create table pinfen +( + number float(3) not null, + primary key (number) +); + +alter table canyan add constraint FK_canyan foreign key (aid) + references actor (aid) on delete restrict on update restrict; + +alter table canyan add constraint FK_canyan2 foreign key (did) + references director (did) on delete restrict on update restrict; + +alter table movie add constraint FK_guanlian foreign key (number) + references pinfen (number) on delete restrict on update restrict; + +alter table movie add constraint FK_zhidao foreign key (did) + references director (did) on delete restrict on update restrict; +``` + diff --git "a/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" "b/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" new file mode 100644 index 0000000..5d10bfc --- /dev/null +++ "b/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" @@ -0,0 +1,68 @@ +# 一、表和表之间的关系 + +## 1.一对一 + +###   1.概念:一个表中的数据只能对应另一个表中的另一个数据,反之亦然。 + +###   2.案例:公民身份证号和本人姓名。 + + + +## 2.一对多 + +###   1.概念:一个表中的数据能对应上另一个表中的多个数据。 + +###   2.案例:班级表和学生表,一个班级有多个学生但是一个学生只有一个班级。 + + + + + +## 3.多对多 + +###   1.概念:一个表中的一条数据可以关联到另一个表中的多条数据,反之亦然 + +###   2.案例:课程表和学生表互相有多个数据可以相互查询 + + + + + +# 三、三大范式 + +### 1.不可分割 + +### 2.非主键要全部依赖于主键,而且还不能只是部分依赖 + +### 3.在满足第二范式的基础上,确保每个非主键字段只依赖于主键,而不依赖于其他非主键字段。这意味着非主键字段之间不能有依赖关系,必须相互独立。 + + + +# 四、PowerDesigner + +### 1.CDM:概念模型 + +### 2.LDM:逻辑模型 + +### 3.PDM: 物理模型 + +###    + +## 五、图床及picgo的使用及实现md自动上传图片至gitee仓库 + +1.在gitee上创建一个图床图片存储的开源仓库,同时在picgo上配置gitee的地址及私人令牌 + + + +2.安装picgo,在官网安装,同时设置picgo的node.js和gitee插件 + + + +3.在typroa上配置好picgo + + + +4.配合神器snipaste + + + -- Gitee From abae4d7254b344b05697740e633b8df7650b81b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E9=B9=8A=E6=9D=83?= <1773509020@qq.com> Date: Sat, 7 Sep 2024 15:58:15 +0000 Subject: [PATCH 3/7] =?UTF-8?q?rename=2020240903=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=AE=BE=E8=AE=A1.md=20to=20=E8=8B=8F=E9=B9=8A?= =?UTF-8?q?=E6=9D=83/=E7=AC=94=E8=AE=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 苏鹊权 <1773509020@qq.com> --- .../\347\254\224\350\256\260" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" => "\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260" (100%) diff --git "a/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" "b/\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260" similarity index 100% rename from "20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241.md" rename to "\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260" -- Gitee From 799ecb82e19fa93884e272b5146721210ce43198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E9=B9=8A=E6=9D=83?= <1773509020@qq.com> Date: Sat, 7 Sep 2024 15:59:55 +0000 Subject: [PATCH 4/7] =?UTF-8?q?update=2020240907=20git=E7=9A=84=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=92=8Cpicgo=E5=A6=82=E4=BD=95=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E5=BA=8A.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 苏鹊权 <1773509020@qq.com> --- ...12\344\274\240\345\233\276\345\272\212.md" | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 "20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" diff --git "a/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" "b/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" deleted file mode 100644 index 5d10bfc..0000000 --- "a/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" +++ /dev/null @@ -1,68 +0,0 @@ -# 一、表和表之间的关系 - -## 1.一对一 - -###   1.概念:一个表中的数据只能对应另一个表中的另一个数据,反之亦然。 - -###   2.案例:公民身份证号和本人姓名。 - - - -## 2.一对多 - -###   1.概念:一个表中的数据能对应上另一个表中的多个数据。 - -###   2.案例:班级表和学生表,一个班级有多个学生但是一个学生只有一个班级。 - - - - - -## 3.多对多 - -###   1.概念:一个表中的一条数据可以关联到另一个表中的多条数据,反之亦然 - -###   2.案例:课程表和学生表互相有多个数据可以相互查询 - - - - - -# 三、三大范式 - -### 1.不可分割 - -### 2.非主键要全部依赖于主键,而且还不能只是部分依赖 - -### 3.在满足第二范式的基础上,确保每个非主键字段只依赖于主键,而不依赖于其他非主键字段。这意味着非主键字段之间不能有依赖关系,必须相互独立。 - - - -# 四、PowerDesigner - -### 1.CDM:概念模型 - -### 2.LDM:逻辑模型 - -### 3.PDM: 物理模型 - -###    - -## 五、图床及picgo的使用及实现md自动上传图片至gitee仓库 - -1.在gitee上创建一个图床图片存储的开源仓库,同时在picgo上配置gitee的地址及私人令牌 - - - -2.安装picgo,在官网安装,同时设置picgo的node.js和gitee插件 - - - -3.在typroa上配置好picgo - - - -4.配合神器snipaste - - - -- Gitee From b7aec233d85d95252d9811a45ae44f6b513f174d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E9=B9=8A=E6=9D=83?= <1773509020@qq.com> Date: Sat, 7 Sep 2024 16:01:00 +0000 Subject: [PATCH 5/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 苏鹊权 <1773509020@qq.com> --- ...12\344\274\240\345\233\276\345\272\212.md" | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 "20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" diff --git "a/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" "b/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" new file mode 100644 index 0000000..5d10bfc --- /dev/null +++ "b/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" @@ -0,0 +1,68 @@ +# 一、表和表之间的关系 + +## 1.一对一 + +###   1.概念:一个表中的数据只能对应另一个表中的另一个数据,反之亦然。 + +###   2.案例:公民身份证号和本人姓名。 + + + +## 2.一对多 + +###   1.概念:一个表中的数据能对应上另一个表中的多个数据。 + +###   2.案例:班级表和学生表,一个班级有多个学生但是一个学生只有一个班级。 + + + + + +## 3.多对多 + +###   1.概念:一个表中的一条数据可以关联到另一个表中的多条数据,反之亦然 + +###   2.案例:课程表和学生表互相有多个数据可以相互查询 + + + + + +# 三、三大范式 + +### 1.不可分割 + +### 2.非主键要全部依赖于主键,而且还不能只是部分依赖 + +### 3.在满足第二范式的基础上,确保每个非主键字段只依赖于主键,而不依赖于其他非主键字段。这意味着非主键字段之间不能有依赖关系,必须相互独立。 + + + +# 四、PowerDesigner + +### 1.CDM:概念模型 + +### 2.LDM:逻辑模型 + +### 3.PDM: 物理模型 + +###    + +## 五、图床及picgo的使用及实现md自动上传图片至gitee仓库 + +1.在gitee上创建一个图床图片存储的开源仓库,同时在picgo上配置gitee的地址及私人令牌 + + + +2.安装picgo,在官网安装,同时设置picgo的node.js和gitee插件 + + + +3.在typroa上配置好picgo + + + +4.配合神器snipaste + + + -- Gitee From 8659af9765f41df0d3f30adce7d71119e6bd6b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E9=B9=8A=E6=9D=83?= <1773509020@qq.com> Date: Sat, 7 Sep 2024 16:01:39 +0000 Subject: [PATCH 6/7] =?UTF-8?q?rename=2020240907=20git=E7=9A=84=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=92=8Cpicgo=E5=A6=82=E4=BD=95=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E5=BA=8A.md=20to=20=E8=8B=8F=E9=B9=8A=E6=9D=83/202409?= =?UTF-8?q?07=20git=E7=9A=84=E4=BD=BF=E7=94=A8=E5=92=8Cpicgo=E5=A6=82?= =?UTF-8?q?=E4=BD=95=E4=B8=8A=E4=BC=A0=E5=9B=BE=E5=BA=8A.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 苏鹊权 <1773509020@qq.com> --- ...44\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" => "\350\213\217\351\271\212\346\235\203/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" (100%) diff --git "a/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" "b/\350\213\217\351\271\212\346\235\203/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" similarity index 100% rename from "20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" rename to "\350\213\217\351\271\212\346\235\203/20240907 git\347\232\204\344\275\277\347\224\250\345\222\214picgo\345\246\202\344\275\225\344\270\212\344\274\240\345\233\276\345\272\212.md" -- Gitee From ad9a45e6733dc613784a5cf4d6b4bba5807b136d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E9=B9=8A=E6=9D=83?= <1773509020@qq.com> Date: Sat, 7 Sep 2024 16:03:02 +0000 Subject: [PATCH 7/7] =?UTF-8?q?rename=20=E8=8B=8F=E9=B9=8A=E6=9D=83/?= =?UTF-8?q?=E7=AC=94=E8=AE=B0=20to=20=E8=8B=8F=E9=B9=8A=E6=9D=83/=E7=AC=94?= =?UTF-8?q?=E8=AE=B0/20240903=20=E6=95=B0=E6=8D=AE=E5=BA=93=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 苏鹊权 <1773509020@qq.com> --- ... \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260" => "\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241" (100%) diff --git "a/\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260" "b/\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241" similarity index 100% rename from "\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260" rename to "\350\213\217\351\271\212\346\235\203/\347\254\224\350\256\260/20240903 \346\225\260\346\215\256\345\272\223\350\256\276\350\256\241" -- Gitee