diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/1.png" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/1.png" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/1.png" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/1.png" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/2.png" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/2.png" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/2.png" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/2.png" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/3.png" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/3.png" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/3.png" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/3.png" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/4.png" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/4.png" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/4.png" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/4.png" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/crebas.sql" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/crebas.sql" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/crebas.sql" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/crebas.sql" diff --git "a/\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" "b/\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" similarity index 100% rename from "\346\261\237\346\231\272\346\235\260/\347\254\254\344\270\200\350\212\202\350\257\276/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" rename to "\346\261\237\346\231\272\346\235\260/01 \344\270\211\345\244\247\350\214\203\345\274\217\345\217\212PowerDesigner/\346\225\260\346\215\256\345\272\223\351\253\230\347\272\247\350\256\276\350\256\241\347\254\224\350\256\260.md" diff --git "a/\346\261\237\346\231\272\346\235\260/02 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" "b/\346\261\237\346\231\272\346\235\260/02 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" new file mode 100644 index 0000000000000000000000000000000000000000..cc3818f50efe35c2a5ba71c73b3ed70190d3bc9b --- /dev/null +++ "b/\346\261\237\346\231\272\346\235\260/02 git\344\273\245\345\217\212\346\217\222\344\273\266\347\232\204\344\275\277\347\224\250/20240907 git\347\232\204\344\275\277\347\224\250\345\217\212picgo\346\217\222\344\273\266\344\270\212\344\274\240\345\233\276\345\272\212.md" @@ -0,0 +1,21 @@ +## 图床及picgo插件的使用,实现自动上传到gitee。 + +1. gitee当图床 + +2. 安装配置picgo + + 1. 插件下载(配置node.js环境)![image-20240907211704869](https://gitee.com/dhayyds/picture/raw/master/images/202409072117017.png) + + 2. ![image-20240907211643457](https://gitee.com/dhayyds/picture/raw/master/images/202409072116499.png) + + + + + +3. 配置typroa,使用picgo + + 1. 图像设置![image-20240907211731192](https://gitee.com/dhayyds/picture/raw/master/images/202409072117241.png) + +4. 配合截图软件snipaste + + \ No newline at end of file diff --git "a/\346\261\237\346\231\272\346\235\260/03 RBAC\347\232\204\350\277\220\347\224\250/RBAC\347\232\204\350\277\220\347\224\250.md" "b/\346\261\237\346\231\272\346\235\260/03 RBAC\347\232\204\350\277\220\347\224\250/RBAC\347\232\204\350\277\220\347\224\250.md" new file mode 100644 index 0000000000000000000000000000000000000000..066494542a101e52d4fca5591897f4a854cbeff9 --- /dev/null +++ "b/\346\261\237\346\231\272\346\235\260/03 RBAC\347\232\204\350\277\220\347\224\250/RBAC\347\232\204\350\277\220\347\224\250.md" @@ -0,0 +1,217 @@ +# RBAC的运用 + +## 概念 + +Role-Based Access Control,中文意思是:基于角色(Role)的访问控制。这是一种广泛应用于计算机系统和网络安全领域的访问控制模型 + +通过将 **权限** 分配给 **角色** 分配给 **用户** 来实现对系统资源的访问控制。 + +1. **角色(Role)**:角色是指在系统中具有一组相关权限的抽象概念,代表了用户在特定上下文中的身份或职能,例如管理员、普通用户等。 +2. 权限(Permission):权限是指对系统资源进行操作的许可,如读取、写入、修改等。权限可以被分配给角色。 +3. **用户(User)**:用户是指系统的实际使用者,每个用户可以被分配一个或多个角色。 +4. 分配(Assignment):分配是指将角色与用户关联起来,以赋予用户相应的权限 + +总结就是将权限分配给角色,在将角色分配给用户,使不同的用户拥有不同的权限 + +## 作业要求 + +![image-20240908201935294](https://gitee.com/dhayyds/picture/raw/master/images/202409082019498.png) + +## 作业展示 + +### CDM + +![image-20240908201715177](https://gitee.com/dhayyds/picture/raw/master/images/202409082017432.png) + +### LDM + +![image-20240908201542437](https://gitee.com/dhayyds/picture/raw/master/images/202409082015789.png) + +### PDM + +![image-20240908201753108](https://gitee.com/dhayyds/picture/raw/master/images/202409082017345.png) + +### 生成的sql + +```sql +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2024/9/8 20:10:35 */ +/*==============================================================*/ + + +drop table if exists banzhuren; + +drop table if exists caozuo; + +drop table if exists chengji; + +drop table if exists class; + +drop table if exists juese; + +drop table if exists student; + +drop table if exists teacher; + +drop table if exists teachs; + +drop table if exists xinxi; + +/*==============================================================*/ +/* Table: banzhuren */ +/*==============================================================*/ +create table banzhuren +( + bid int not null, + tno int, + jleixing varchar(5), + primary key (bid) +); + +/*==============================================================*/ +/* Table: caozuo */ +/*==============================================================*/ +create table caozuo +( + czid int not null, + czname varchar(5), + primary key (czid) +); + +/*==============================================================*/ +/* Table: chengji */ +/*==============================================================*/ +create table chengji +( + cname varchar(5) not null, + sno int, + cc int, + primary key (cname) +); + +/*==============================================================*/ +/* Table: class */ +/*==============================================================*/ +create table class +( + clid int not null, + bid int, + primary key (clid) +); + +/*==============================================================*/ +/* Table: juese */ +/*==============================================================*/ +create table juese +( + jleixing varchar(5) not null, + czid int, + primary key (jleixing) +); + +/*==============================================================*/ +/* Table: student */ +/*==============================================================*/ +create table student +( + sno int not null, + name varchar(5), + jleixing varchar(5), + primary key (sno) +); + +/*==============================================================*/ +/* Table: teacher */ +/*==============================================================*/ +create table teacher +( + tno int not null, + name varchar(5), + jleixing varchar(5), + primary key (tno) +); + +/*==============================================================*/ +/* Table: teachs */ +/*==============================================================*/ +create table teachs +( + tno int not null, + clid int not null, + primary key (tno, clid) +); + +/*==============================================================*/ +/* Table: xinxi */ +/*==============================================================*/ +create table xinxi +( + name varchar(5) not null, + age int, + sex varchar(2), + tongyongcaozuo varchar(20), + primary key (name) +); + +alter table banzhuren add constraint FK_Relationship_12 foreign key (tno) + references teacher (tno) on delete restrict on update restrict; + +alter table banzhuren add constraint FK_Relationship_13 foreign key (jleixing) + references juese (jleixing) on delete restrict on update restrict; + +alter table chengji add constraint FK_Relationship_5 foreign key (sno) + references student (sno) on delete restrict on update restrict; + +alter table class add constraint FK_Relationship_18 foreign key (bid) + references banzhuren (bid) on delete restrict on update restrict; + +alter table juese add constraint FK_Relationship_14 foreign key (czid) + references caozuo (czid) on delete restrict on update restrict; + +alter table student add constraint FK_Relationship_15 foreign key (name) + references xinxi (name) on delete restrict on update restrict; + +alter table student add constraint FK_Relationship_9 foreign key (jleixing) + references juese (jleixing) on delete restrict on update restrict; + +alter table teacher add constraint FK_Relationship_10 foreign key (jleixing) + references juese (jleixing) on delete restrict on update restrict; + +alter table teacher add constraint FK_Relationship_16 foreign key (name) + references xinxi (name) on delete restrict on update restrict; + +alter table teachs add constraint FK_Relationship_17 foreign key (clid) + references class (clid) on delete restrict on update restrict; + +alter table teachs add constraint FK_Relationship_8 foreign key (tno) + references teacher (tno) on delete restrict on update restrict; + + +``` + +### 添加测试数据sql + +![image-20240908205658804](https://gitee.com/dhayyds/picture/raw/master/images/202409082056929.png) + +![image-20240908205719148](https://gitee.com/dhayyds/picture/raw/master/images/202409082057280.png) + +```sql +INSERT into juese VALUES('学生'),('老师'),('班主任') + +INSERT INTO caozuo VALUES(1,'学生','学生数据查询'),(2,'老师','添加成绩'),(3,'老师','修改成绩'),(4,'老师','查看成绩'),(5,'班主任','本班学生信息管理'),(6,'班主任','本班考试信息管理') + +INSERT into xinxi VALUES('老丘',18,'男','个人信息'),('老范',18,'男','个人信息'),('老胡',18,'男','个人信息') + +INSERT into teacher VALUES(1,'老丘','老师'),(2,'老范','老师'),(3,'老胡','老师') + +``` + +### 查询 + +![image-20240908205546669](https://gitee.com/dhayyds/picture/raw/master/images/202409082055885.png) + +```sql +SELECT name,czname FROM caozuo c INNER JOIN teacher t on c.jleixing=t.jleixing WHERE name='老丘' +``` + diff --git "a/\346\261\237\346\231\272\346\235\260/jzj.md" "b/\346\261\237\346\231\272\346\235\260/jzj.md" deleted file mode 100644 index 288dbfe02a11477f303343e0b35588a9ff25854f..0000000000000000000000000000000000000000 --- "a/\346\261\237\346\231\272\346\235\260/jzj.md" +++ /dev/null @@ -1,19 +0,0 @@ -# 数据库高级应用 - -## 1. 数据库设计基础 - 1. 表与表的关系 - 2. ER图 - 3. 数据库的三式范式 - 4. 设计数据库的软件 -## 2. 数据库设计基础进阶 - 1. RBAC与SKU -## 3. 数据库高阶语法 - 1. 自连接,左连接,右连接,外连接 - 2. 视图 - 3. 单行函数 - 4. 存储过程 - 5. 分支结构、循环结构 :if while for - 6. 窗口函数 - 7. 触发器 - 8. 索引 - 9. 事务 \ No newline at end of file