diff --git "a/54 \345\217\266\345\255\220\350\261\252/9.8\344\275\234\344\270\232 .md" "b/54 \345\217\266\345\255\220\350\261\252/9.8\344\275\234\344\270\232 .md" new file mode 100644 index 0000000000000000000000000000000000000000..51f084d1cbad498320fc82e4ee47afb1cb11da68 --- /dev/null +++ "b/54 \345\217\266\345\255\220\350\261\252/9.8\344\275\234\344\270\232 .md" @@ -0,0 +1,108 @@ +```mysql +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2023/9/11 13:47:42 */ +/*==============================================================*/ + + +drop table if exists chubanshe; + +drop table if exists guanliyuan; + +drop table if exists jieyuebiao; + +drop table if exists tushufenlei; + +drop table if exists tushuguan; + +drop table if exists xuesheng; + +/*==============================================================*/ +/* Table: chubanshe */ +/*==============================================================*/ +create table chubanshe +( + cbs_id int not null, + ts_id int, + cbs_name varchar(20) not null, + cbs_address varchar(50) not null, + cbs_emal varchar(20) not null, + primary key (cbs_id) +); + +/*==============================================================*/ +/* Table: guanliyuan */ +/*==============================================================*/ +create table guanliyuan +( + gly_id int not null, + gly_name varchar(20) not null, + gly_sex varchar(20) not null, + primary key (gly_id) +); + +/*==============================================================*/ +/* Table: jieyuebiao */ +/*==============================================================*/ +create table jieyuebiao +( + xs_id int not null, + ts_id int not null, + jy_time datetime not null, + gh_time datetime not null, + primary key (xs_id, ts_id) +); + +/*==============================================================*/ +/* Table: tushufenlei */ +/*==============================================================*/ +create table tushufenlei +( + ts_id int not null, + tsg_id int, + ts_name varchar(20) not null, + primary key (ts_id) +); + +/*==============================================================*/ +/* Table: tushuguan */ +/*==============================================================*/ +create table tushuguan +( + tsg_id int not null, + gly_id int, + tsg_name varchar(20) not null, + primary key (tsg_id) +); + +/*==============================================================*/ +/* Table: xuesheng */ +/*==============================================================*/ +create table xuesheng +( + xs_id int not null, + xs_name varchar(20) not null, + xs_age int not null, + xs_class varchar(20) not null, + xs_sex varchar(10) not null, + primary key (xs_id) +); + +alter table chubanshe add constraint FK_Relationship_4 foreign key (ts_id) + references tushufenlei (ts_id) on delete restrict on update restrict; + +alter table jieyuebiao add constraint FK_Relationship_3 foreign key (xs_id) + references xuesheng (xs_id) on delete restrict on update restrict; + +alter table jieyuebiao add constraint FK_Relationship_5 foreign key (ts_id) + references tushufenlei (ts_id) on delete restrict on update restrict; + +alter table tushufenlei add constraint FK_Relationship_2 foreign key (tsg_id) + references tushuguan (tsg_id) on delete restrict on update restrict; + +alter table tushuguan add constraint FK_Relationship_1 foreign key (gly_id) + references guanliyuan (gly_id) on delete restrict on update restrict; + + +``` + diff --git "a/54 \345\217\266\345\255\220\350\261\252/\347\254\254\345\233\233\345\244\251\347\254\224\350\256\260.md" "b/54 \345\217\266\345\255\220\350\261\252/\347\254\254\345\233\233\345\244\251\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..49c2e3cc961b7855d16631cbfd56a45b5427bcfe --- /dev/null +++ "b/54 \345\217\266\345\255\220\350\261\252/\347\254\254\345\233\233\345\244\251\347\254\224\350\256\260.md" @@ -0,0 +1,11 @@ + + +# Power Designer: + +第一步:创建概念模型(类似ER图)CDM + +第二步:转换成逻辑模型 LDM + +第三步:转换成物理模型 PDM + +第四步:生成 DDL \ No newline at end of file