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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git "a/\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" "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" new file mode 100644 index 0000000000000000000000000000000000000000..5d10bfc9347fe1e60124f839f911e4127a855e31 --- /dev/null +++ "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" @@ -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 + + + diff --git "a/\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" "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" new file mode 100644 index 0000000000000000000000000000000000000000..3ffe5c12cfc00beaf948120930eea0ee363711fc --- /dev/null +++ "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" @@ -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; +``` +