diff --git "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/PiSco\345\246\202\344\275\225\344\275\277\347\224\250/20240907.md.txt" "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/PiSco\345\246\202\344\275\225\344\275\277\347\224\250/20240907.md.txt" new file mode 100644 index 0000000000000000000000000000000000000000..31821df3939437faaea0783161ba4e79355d4c71 --- /dev/null +++ "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/PiSco\345\246\202\344\275\225\344\275\277\347\224\250/20240907.md.txt" @@ -0,0 +1,23 @@ +三大范式: + 1. 第一范式(1NF) + +目标: 确保每个表格中的字段都包含原子值,即每个字段只能存储一个单一的值,不允许出现重复的组。 + +定义:原子性: 每个字段的值必须是最基本的数据项,不能包含列表或集合。 + +2. 第二范式(2NF) + +目标: 确保每个非主属性完全依赖于主键,而不是主键的一部分。解决了部分依赖的问题。 + +定义:完全依赖: 非主属性必须依赖于整个主键(如果是复合主键),而不是主键的某个部分。 + + 3. 第三范式(3NF) + +目标: 确保每个非主属性既不依赖于主键的部分,也不依赖于其他非主属性(消除传递依赖。 + +定义:消除传递依赖: 非主属性只直接依赖于主键,不应依赖于其他非主属性 + +Picgo的使用 +first:先下载node.js,因为需要使用到github,利用stream++进行加速; +second:利用PiGco进行gitee设置 +Last:进行注册 \ No newline at end of file diff --git "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/20240908.md" "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/20240908.md" new file mode 100644 index 0000000000000000000000000000000000000000..7d428c0f7bbc67dfc53d5e3920decb868162e4c6 --- /dev/null +++ "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/20240908.md" @@ -0,0 +1,502 @@ +```.sql + +/*==============================================================*/ +/* DBMS name: Sybase SQL Anywhere 12 */ +/* Created on: 2024/9/8 15:46:55 */ +/*==============================================================*/ + + +if exists(select 1 from sys.sysforeignkey where role='FK_COTROLLA_TCHOALL_TEACHER') then + alter table Cotrollal + delete foreign key FK_COTROLLA_TCHOALL_TEACHER +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_COTROLLA_USEING_STUDENT') then + alter table Cotrollal + delete foreign key FK_COTROLLA_USEING_STUDENT +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_SCORE_RELATION_COURSE') then + alter table Score + delete foreign key FK_SCORE_RELATION_COURSE +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_SCORE_TEST_STUDENT') then + alter table Score + delete foreign key FK_SCORE_TEST_STUDENT +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_DIRECTOR_ONE_TEACHER') then + alter table director + delete foreign key FK_DIRECTOR_ONE_TEACHER +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_LINK_LINK_COURSE') then + alter table link + delete foreign key FK_LINK_LINK_COURSE +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_LINK_LINK2_STUDENT') then + alter table link + delete foreign key FK_LINK_LINK2_STUDENT +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_STUDENT_BELONG_TEACHER') then + alter table student + delete foreign key FK_STUDENT_BELONG_TEACHER +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_STUDENT_COME_CLASS') then + alter table student + delete foreign key FK_STUDENT_COME_CLASS +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_TEACHER_TACH_CLASS') then + alter table teacher + delete foreign key FK_TEACHER_TACH_CLASS +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_TEACHER_CCLASSFYS_教师职位表') then + alter table teacher + delete foreign key FK_TEACHER_CCLASSFYS_教师职位表 +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_TEACHER_ONE2_DIRECTOR') then + alter table teacher + delete foreign key FK_TEACHER_ONE2_DIRECTOR +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_TEACHER_RELATE_COURSE') then + alter table teacher + delete foreign key FK_TEACHER_RELATE_COURSE +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_教师职位表_CCLASSFYS_TEACHER') then + alter table 教师职位表 + delete foreign key FK_教师职位表_CCLASSFYS_TEACHER +end if; + +drop index if exists Class.Class_PK; + +drop table if exists Class; + +drop index if exists Cotrollal.has_FK; + +drop index if exists Cotrollal.tchoall_FK; + +drop index if exists Cotrollal.Cotrollal_PK; + +drop table if exists Cotrollal; + +drop index if exists Score.relation_FK; + +drop index if exists Score.test_FK; + +drop index if exists Score.Score_PK; + +drop table if exists Score; + +drop index if exists course.course_PK; + +drop table if exists course; + +drop index if exists director.classify_FK; + +drop index if exists director.director_PK; + +drop table if exists director; + +drop index if exists link.link2_FK; + +drop index if exists link.link_FK; + +drop index if exists link.link_PK; + +drop table if exists link; + +drop index if exists student.belong_FK; + +drop index if exists student.come_FK; + +drop index if exists student.student_PK; + +drop table if exists student; + +drop index if exists teacher.relate_FK; + +drop index if exists teacher.Tach_FK; + +drop index if exists teacher.classify2_FK; + +drop index if exists teacher.inform2_FK; + +drop index if exists teacher.teacher_PK; + +drop table if exists teacher; + +drop index if exists 教师职位表.inform_FK; + +drop index if exists 教师职位表.教师职位表_PK; + +drop table if exists 教师职位表; + +/*==============================================================*/ +/* Table: Class */ +/*==============================================================*/ +create table Class +( + fid integer not null, + fname varchar(11) null, + constraint PK_CLASS primary key (fid) +); + +/*==============================================================*/ +/* Index: Class_PK */ +/*==============================================================*/ +create unique index Class_PK on Class ( +fid ASC +); + +/*==============================================================*/ +/* Table: Cotrollal */ +/*==============================================================*/ +create table Cotrollal +( + aid integer not null, + sid integer null, + tid integer not null, + aname varchar(11) null, + constraint PK_COTROLLAL primary key (aid) +); + +/*==============================================================*/ +/* Index: Cotrollal_PK */ +/*==============================================================*/ +create unique index Cotrollal_PK on Cotrollal ( +aid ASC +); + +/*==============================================================*/ +/* Index: tchoall_FK */ +/*==============================================================*/ +create index tchoall_FK on Cotrollal ( +tid ASC +); + +/*==============================================================*/ +/* Index: has_FK */ +/*==============================================================*/ +create index has_FK on Cotrollal ( +sid ASC +); + +/*==============================================================*/ +/* Table: Score */ +/*==============================================================*/ +create table Score +( + pid integer not null, + sid integer not null, + oid integer not null, + pscore varchar(11) null, + constraint PK_SCORE primary key (pid) +); + +/*==============================================================*/ +/* Index: Score_PK */ +/*==============================================================*/ +create unique index Score_PK on Score ( +pid ASC +); + +/*==============================================================*/ +/* Index: test_FK */ +/*==============================================================*/ +create index test_FK on Score ( +sid ASC +); + +/*==============================================================*/ +/* Index: relation_FK */ +/*==============================================================*/ +create index relation_FK on Score ( +oid ASC +); + +/*==============================================================*/ +/* Table: course */ +/*==============================================================*/ +create table course +( + oid integer not null, + oname varchar(255) null, + constraint PK_COURSE primary key (oid) +); + +/*==============================================================*/ +/* Index: course_PK */ +/*==============================================================*/ +create unique index course_PK on course ( +oid ASC +); + +/*==============================================================*/ +/* Table: director */ +/*==============================================================*/ +create table director +( + did char(10) not null, + tid integer null, + dname char(10) null, + constraint PK_DIRECTOR primary key (did) +); + +/*==============================================================*/ +/* Index: director_PK */ +/*==============================================================*/ +create unique index director_PK on director ( +did ASC +); + +/*==============================================================*/ +/* Index: classify_FK */ +/*==============================================================*/ +create index classify_FK on director ( +tid ASC +); + +/*==============================================================*/ +/* Table: link */ +/*==============================================================*/ +create table link +( + oid integer not null, + sid integer not null, + constraint PK_LINK primary key clustered (oid, sid) +); + +/*==============================================================*/ +/* Index: link_PK */ +/*==============================================================*/ +create unique clustered index link_PK on link ( +oid ASC, +sid ASC +); + +/*==============================================================*/ +/* Index: link_FK */ +/*==============================================================*/ +create index link_FK on link ( +oid ASC +); + +/*==============================================================*/ +/* Index: link2_FK */ +/*==============================================================*/ +create index link2_FK on link ( +sid ASC +); + +/*==============================================================*/ +/* Table: student */ +/*==============================================================*/ +create table student +( + sid integer not null, + fid integer not null, + tid integer not null, + sname varchar(11) null, + sclass integer null, + score float(11) null, + scollotrol integer null, + constraint PK_STUDENT primary key (sid) +); + +/*==============================================================*/ +/* Index: student_PK */ +/*==============================================================*/ +create unique index student_PK on student ( +sid ASC +); + +/*==============================================================*/ +/* Index: come_FK */ +/*==============================================================*/ +create index come_FK on student ( +fid ASC +); + +/*==============================================================*/ +/* Index: belong_FK */ +/*==============================================================*/ +create index belong_FK on student ( +tid ASC +); + +/*==============================================================*/ +/* Table: teacher */ +/*==============================================================*/ +create table teacher +( + tid integer not null, + gid integer null, + oid integer not null, + did char(10) null, + fid integer not null, + tclass integer null, + ttcollotrol integer null, + ttcy integer null, + constraint PK_TEACHER primary key (tid) +); + +/*==============================================================*/ +/* Index: teacher_PK */ +/*==============================================================*/ +create unique index teacher_PK on teacher ( +tid ASC +); + +/*==============================================================*/ +/* Index: inform2_FK */ +/*==============================================================*/ +create index inform2_FK on teacher ( +gid ASC +); + +/*==============================================================*/ +/* Index: classify2_FK */ +/*==============================================================*/ +create index classify2_FK on teacher ( +did ASC +); + +/*==============================================================*/ +/* Index: Tach_FK */ +/*==============================================================*/ +create index Tach_FK on teacher ( +fid ASC +); + +/*==============================================================*/ +/* Index: relate_FK */ +/*==============================================================*/ +create index relate_FK on teacher ( +oid ASC +); + +/*==============================================================*/ +/* Table: 教师职位表 */ +/*==============================================================*/ +create table 教师职位表 +( + gid integer not null, + tid integer null, + gname varchar(11) null, + constraint PK_教师职位表 primary key (gid) +); + +/*==============================================================*/ +/* Index: 教师职位表_PK */ +/*==============================================================*/ +create unique index 教师职位表_PK on 教师职位表 ( +gid ASC +); + +/*==============================================================*/ +/* Index: inform_FK */ +/*==============================================================*/ +create index inform_FK on 教师职位表 ( +tid ASC +); + +alter table Cotrollal + add constraint FK_COTROLLA_TCHOALL_TEACHER foreign key (tid) + references teacher (tid) + on update restrict + on delete restrict; + +alter table Cotrollal + add constraint FK_COTROLLA_USEING_STUDENT foreign key (sid) + references student (sid) + on update restrict + on delete restrict; + +alter table Score + add constraint FK_SCORE_RELATION_COURSE foreign key (oid) + references course (oid) + on update restrict + on delete restrict; + +alter table Score + add constraint FK_SCORE_TEST_STUDENT foreign key (sid) + references student (sid) + on update restrict + on delete restrict; + +alter table director + add constraint FK_DIRECTOR_ONE_TEACHER foreign key (tid) + references teacher (tid) + on update restrict + on delete restrict; + +alter table link + add constraint FK_LINK_LINK_COURSE foreign key (oid) + references course (oid) + on update restrict + on delete restrict; + +alter table link + add constraint FK_LINK_LINK2_STUDENT foreign key (sid) + references student (sid) + on update restrict + on delete restrict; + +alter table student + add constraint FK_STUDENT_BELONG_TEACHER foreign key (tid) + references teacher (tid) + on update restrict + on delete restrict; + +alter table student + add constraint FK_STUDENT_COME_CLASS foreign key (fid) + references Class (fid) + on update restrict + on delete restrict; + +alter table teacher + add constraint FK_TEACHER_TACH_CLASS foreign key (fid) + references Class (fid) + on update restrict + on delete restrict; + +alter table teacher + add constraint FK_TEACHER_CCLASSFYS_教师职位表 foreign key (gid) + references 教师职位表 (gid) + on update restrict + on delete restrict; + +alter table teacher + add constraint FK_TEACHER_ONE2_DIRECTOR foreign key (did) + references director (did) + on update restrict + on delete restrict; + +alter table teacher + add constraint FK_TEACHER_RELATE_COURSE foreign key (oid) + references course (oid) + on update restrict + on delete restrict; + +alter table 教师职位表 + add constraint FK_教师职位表_CCLASSFYS_TEACHER foreign key (tid) + references teacher (tid) + on update restrict + on delete restrict; + +``` + + + +![图片1](C:\Users\31300\Desktop\advanced-database-applications\2344310101_软件技术1班_叶俊杰\RBAC是什么?\图片1.png) + +![图片2](C:\Users\31300\Desktop\advanced-database-applications\2344310101_软件技术1班_叶俊杰\RBAC是什么?\图片2.png) \ No newline at end of file diff --git "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/\345\233\276\347\211\2071.png" "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/\345\233\276\347\211\2071.png" new file mode 100644 index 0000000000000000000000000000000000000000..4e5c53d4c26dfc759653b9afad39f5eb99861879 Binary files /dev/null and "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/\345\233\276\347\211\2071.png" differ diff --git "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/\345\233\276\347\211\2072.png" "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/\345\233\276\347\211\2072.png" new file mode 100644 index 0000000000000000000000000000000000000000..4e5c53d4c26dfc759653b9afad39f5eb99861879 Binary files /dev/null and "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/RBAC\346\230\257\344\273\200\344\271\210\357\274\237/\345\233\276\347\211\2072.png" differ diff --git "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/zuoye.md" "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/20240904.md" similarity index 82% rename from "2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/zuoye.md" rename to "2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/20240904.md" index ac9c4f110c2e28ad3b671b035ab73e57b4c89f8a..8bd7f6f7f7411af93e802fc231820920360c2767 100644 --- "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/zuoye.md" +++ "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/20240904.md" @@ -1,3 +1,5 @@ +```.sql + /*==============================================================*/ /* DBMS name: MySQL 5.0 */ /* Created on: 2024/9/5 0:03:35 */ @@ -57,7 +59,7 @@ create table goods gtype varchar(13), cid int, gprice float(13), - int, + Àà±ð±àºÅ int, primary key (gid) ); @@ -83,3 +85,12 @@ alter table goods add constraint FK_has foreign key (zid) alter table goods add constraint FK_to2 foreign key (wid) references cost (wid) on delete restrict on update restrict; +``` + + + +![微信图片_20240908160914](C:\Users\31300\Desktop\advanced-database-applications\2344310101_软件技术1班_叶俊杰\数据库设计\微信图片_20240908160914.png) + +![微信图片_20240908160922](C:\Users\31300\Desktop\advanced-database-applications\2344310101_软件技术1班_叶俊杰\数据库设计\微信图片_20240908160922.png) + +![微信图片_20240908160914](C:\Users\31300\Desktop\advanced-database-applications\2344310101_软件技术1班_叶俊杰\数据库设计\微信图片_20240908160914.png) \ No newline at end of file diff --git "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\345\276\256\344\277\241\345\233\276\347\211\207_20240905093952.png" "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\345\276\256\344\277\241\345\233\276\347\211\207_20240908160914.png" similarity index 100% rename from "2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\345\276\256\344\277\241\345\233\276\347\211\207_20240905093952.png" rename to "2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\345\276\256\344\277\241\345\233\276\347\211\207_20240908160914.png" diff --git "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\345\276\256\344\277\241\345\233\276\347\211\207_20240905094000.png" "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\345\276\256\344\277\241\345\233\276\347\211\207_20240908160922.png" similarity index 100% rename from "2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\345\276\256\344\277\241\345\233\276\347\211\207_20240905094000.png" rename to "2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\345\276\256\344\277\241\345\233\276\347\211\207_20240908160922.png" diff --git "a/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\345\276\256\344\277\241\345\233\276\347\211\207_20240905094004.png" "b/2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\345\276\256\344\277\241\345\233\276\347\211\207_20240908160926.png" similarity index 100% rename from "2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\345\276\256\344\277\241\345\233\276\347\211\207_20240905094004.png" rename to "2344310101_\350\275\257\344\273\266\346\212\200\346\234\2571\347\217\255_\345\217\266\344\277\212\346\235\260/\346\225\260\346\215\256\345\272\223\350\256\276\350\256\241/\345\276\256\344\277\241\345\233\276\347\211\207_20240908160926.png"