diff --git "a/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/QQ_1725716197568.png" "b/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/QQ_1725716197568.png" new file mode 100644 index 0000000000000000000000000000000000000000..da31cfb10fc5567974fcda360ca513fa8d279961 Binary files /dev/null and "b/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/QQ_1725716197568.png" differ diff --git "a/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/crebas.sql" "b/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/crebas.sql" new file mode 100644 index 0000000000000000000000000000000000000000..80851c6f6505647201393898576c99a367dee386 --- /dev/null +++ "b/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/crebas.sql" @@ -0,0 +1,204 @@ +/*==============================================================*/ +/* DBMS name: Sybase SQL Anywhere 12 */ +/* Created on: 2024/9/7 21:36:12 */ +/*==============================================================*/ + + +if exists(select 1 from sys.sysforeignkey where role='FK_CLASS_RELATIONS_STUDENT') then + alter table class + delete foreign key FK_CLASS_RELATIONS_STUDENT +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_STUDENT_RELATIONS_STUDENT') then + alter table student + delete foreign key FK_STUDENT_RELATIONS_STUDENT +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_STUDENT_一对多_CLASS') then + alter table student + delete foreign key FK_STUDENT_一对多_CLASS +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_多对多_多对多_TEACHER') then + alter table 多对多 + delete foreign key FK_多对多_多对多_TEACHER +end if; + +if exists(select 1 from sys.sysforeignkey where role='FK_多对多_多对多2_STUDENT') then + alter table 多对多 + delete foreign key FK_多对多_多对多2_STUDENT +end if; + +drop index if exists class.Relationship_1_FK; + +drop index if exists class.class_PK; + +drop table if exists class; + +drop index if exists student.一对多_FK; + +drop index if exists student.Relationship_2_FK; + +drop index if exists student.student_PK; + +drop table if exists student; + +drop index if exists teacher.teacher_PK; + +drop table if exists teacher; + +drop index if exists 多对多.多对多_FK; + +drop index if exists 多对多.多对多2_FK; + +drop index if exists 多对多.多对多_PK; + +drop table if exists 多对多; + +/*==============================================================*/ +/* Table: class */ +/*==============================================================*/ +create table class +( + 班级编号 numeric(11) not null, + id numeric(10) null, + 班级名称 varchar(100) null, + 班级人数 numeric(11) null, + constraint PK_CLASS primary key (班级编号) +); + +/*==============================================================*/ +/* Index: class_PK */ +/*==============================================================*/ +create unique index class_PK on class ( +班级编号 ASC +); + +/*==============================================================*/ +/* Index: Relationship_1_FK */ +/*==============================================================*/ +create index Relationship_1_FK on class ( +id ASC +); + +/*==============================================================*/ +/* Table: student */ +/*==============================================================*/ +create table student +( + id numeric(10) not null, + stu_id numeric(10) null, + 班级编号 numeric(11) null, + name varchar(50) not null, + sex varchar(50) not null, + age numeric(10) not null, + constraint PK_STUDENT primary key (id) +); + +/*==============================================================*/ +/* Index: student_PK */ +/*==============================================================*/ +create unique index student_PK on student ( +id ASC +); + +/*==============================================================*/ +/* Index: Relationship_2_FK */ +/*==============================================================*/ +create index Relationship_2_FK on student ( +stu_id ASC +); + +/*==============================================================*/ +/* Index: 一对多_FK */ +/*==============================================================*/ +create index 一对多_FK on student ( +班级编号 ASC +); + +/*==============================================================*/ +/* Table: teacher */ +/*==============================================================*/ +create table teacher +( + teacherid numeric(10) not null, + teachername varchar(50) null, + teachersex numeric(4) null, + constraint PK_TEACHER primary key (teacherid) +); + +/*==============================================================*/ +/* Index: teacher_PK */ +/*==============================================================*/ +create unique index teacher_PK on teacher ( +teacherid ASC +); + +/*==============================================================*/ +/* Table: 多对多 */ +/*==============================================================*/ +create table 多对多 +( + teacherid numeric(10) not null, + id numeric(10) not null, + constraint PK_多对多 primary key (teacherid, id) +); + +comment on table 多对多 is +'一个学生对应多个老师,反之亦然'; + +/*==============================================================*/ +/* Index: 多对多_PK */ +/*==============================================================*/ +create unique index 多对多_PK on 多对多 ( +teacherid ASC, +id ASC +); + +/*==============================================================*/ +/* Index: 多对多2_FK */ +/*==============================================================*/ +create index 多对多2_FK on 多对多 ( +id ASC +); + +/*==============================================================*/ +/* Index: 多对多_FK */ +/*==============================================================*/ +create index 多对多_FK on 多对多 ( +teacherid ASC +); + +alter table class + add constraint FK_CLASS_RELATIONS_STUDENT foreign key (id) + references student (id) + on update restrict + on delete restrict; + +alter table student + add constraint FK_STUDENT_RELATIONS_STUDENT foreign key (stu_id) + references student (id) + on update restrict + on delete restrict; + +alter table student + add constraint FK_STUDENT_一对多_CLASS foreign key (班级编号) + references class (班级编号) + on update restrict + on delete restrict; + +comment on foreign key student.FK_STUDENT_一对多_CLASS is +'一个班级对应多个学生'; + +alter table 多对多 + add constraint FK_多对多_多对多_TEACHER foreign key (teacherid) + references teacher (teacherid) + on update restrict + on delete restrict; + +alter table 多对多 + add constraint FK_多对多_多对多2_STUDENT foreign key (id) + references student (id) + on update restrict + on delete restrict; + diff --git "a/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/\347\254\224\350\256\260.md" "b/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..c50be9d9fc9ed020a533188eb993c393a0ee32b9 --- /dev/null +++ "b/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240904/\347\254\224\350\256\260.md" @@ -0,0 +1,18 @@ +1. 涓瀵逛竴鑱旂郴(1:1): -涓涓疄浣撶殑姣忎釜瀹炰緥鍙叧鑱斿彟涓涓疄浣撶殑涓涓疄渚2. 涓瀵瑰鑱旂郴(1:n):涓涓疄浣撶殑姣忎釜瀹炰緥鍙互鍏宠仈鍙-涓涓疄浣撶殑澶氫釜瀹炰緥3.澶氬澶氳仈绯(m:n):涓や釜瀹炰綋鐨勫涓疄渚嬩箣闂村彲浠ョ浉浜掑叧鑱 + + +1.绗1鑼冨紡(1NF) : + +鏁版嵁琛ㄤ腑鐨勬瘡-鍒楅兘蹇呴』鏄師瀛愮殑锛屽嵆鍒椾腑鐨勬瘡涓奸兘鏄笉鍙啀鍒嗙殑鍩烘湰鏁版嵁椤 + +姣斿涓涓〃涓殑鏌-涓鍒椾笉鑳藉寘鍚涓兼垨闆嗗悎 + +2.绗2鑼冨紡(2NF) : + +鍦ㄦ弧瓒崇涓鑼冨紡鐨勫熀纭_ 涓婏紝瑕佹眰姣忎釜闈炰富灞炴у畬鍏ㄥ嚱鏁颁緷璧栦簬涓婚敭锛屽嵆姣忎釜闈炰富灞炴ч兘蹇呴』渚濊禆浜庢暣涓富閿(鑰屼笉鏄富閿殑1閮ㄥ垎) + +渚嬪锛屽鏋滀富閿槸澶嶅悎涓婚敭锛岄偅涔堟墍鏈夐潪涓诲睘鎬у繀椤讳緷璧栦簬涓婚敭鐨勬墍鏈夐儴鍒 + +3.绗3鑼冨紡(3NF) : + +鍦ㄦ弧瓒崇浜岃寖寮忕殑鍩虹涓婏紝瑕佹眰姣忎釜闈炰富灞炴х洿鎺ヤ緷璧栦簬涓婚敭锛岃屼笉鏄緷璧栦簬鍏朵粬闈炰富灞炴с傘備篃灏辨槸璇达紝娑堥櫎浼犻掍緷璧栥備緥濡傦紝鑻鈫 B鍜孊鈫扖,閭d箞搴旀湁A 鈫 C,浠ユ秷闄鐨勪緷璧栧叧绯 \ No newline at end of file diff --git "a/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240907/0907\347\254\224\350\256\260.md" "b/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240907/0907\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..219c9c80c88f2f49abcd4468cdbd8df296ace42e --- /dev/null +++ "b/\346\261\237\350\264\244\346\246\225/2344310109\346\261\237\350\264\244\346\246\225/20240907/0907\347\254\224\350\256\260.md" @@ -0,0 +1,8 @@ +1. gitee褰撳浘搴 +2. 瀹夎閰嶇疆picgo +3. 閰嶇疆typroa锛屼娇鐢╬icgo +Picgo鐨勪娇鐢 +鍏堜笅杞絥ode.js,鍥犱负闇瑕佷娇鐢ㄥ埌github,鍒╃敤stream++杩涜鍔犻; +鐒跺悗鍒╃敤PiGco杩涜gitee璁剧疆 +鏈鍚庤繘琛屾敞鍐# 鍥惧簥鍙妏icgo鎻掍欢鐨勪娇鐢紝瀹炵幇鑷姩涓婁紶鍒癵itee +4. 閰嶅悎鎴浘杞欢snipaste \ No newline at end of file