diff --git "a/\345\210\230\345\277\227\345\274\272/zuoye.md" "b/\345\210\230\345\277\227\345\274\272/zuoye.md" new file mode 100644 index 0000000000000000000000000000000000000000..24a47b526f0d2193c09e522196c47ffc50265179 --- /dev/null +++ "b/\345\210\230\345\277\227\345\274\272/zuoye.md" @@ -0,0 +1,101 @@ +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2024/9/4 21:10:18 */ +/*==============================================================*/ + + +drop table if exists firm; + +drop table if exists has; + +drop table if exists plance; + +drop table if exists type; + +drop table if exists usc; + +drop table if exists user; + +/*==============================================================*/ +/* Table: firm */ +/*==============================================================*/ +create table firm +( + fid int not null, + fname varchar(11), + primary key (fid) +); + +/*==============================================================*/ +/* Table: has */ +/*==============================================================*/ +create table has +( + fid int not null, + tid int not null, + primary key (fid, tid) +); + +/*==============================================================*/ +/* Table: plance */ +/*==============================================================*/ +create table plance +( + pid int not null, + tid int not null, + pname varchar(11), + time time, + primary key (pid) +); + +/*==============================================================*/ +/* Table: type */ +/*==============================================================*/ +create table type +( + tid int not null, + tname varchar(11), + primary key (tid) +); + +/*==============================================================*/ +/* Table: usc */ +/*==============================================================*/ +create table usc +( + fid int not null, + pid int not null, + primary key (fid, pid) +); + +/*==============================================================*/ +/* Table: user */ +/*==============================================================*/ +create table user +( + uid int not null, + pid int not null, + uname varchar(11), + num float(11,0), + age float(11), + primary key (uid) +); + +alter table has add constraint FK_has foreign key (fid) + references firm (fid) on delete restrict on update restrict; + +alter table has add constraint FK_has2 foreign key (tid) + references type (tid) on delete restrict on update restrict; + +alter table plance add constraint FK_have foreign key (tid) + references type (tid) on delete restrict on update restrict; + +alter table usc add constraint FK_usc foreign key (fid) + references firm (fid) on delete restrict on update restrict; + +alter table usc add constraint FK_usc2 foreign key (pid) + references plance (pid) on delete restrict on update restrict; + +alter table user add constraint FK_ride foreign key (pid) + references plance (pid) on delete restrict on update restrict; + diff --git "a/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 204000.png" "b/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 204000.png" new file mode 100644 index 0000000000000000000000000000000000000000..34e522b87a1ac788c5edc41878f28132851dae2d Binary files /dev/null and "b/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 204000.png" differ diff --git "a/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 204513.png" "b/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 204513.png" new file mode 100644 index 0000000000000000000000000000000000000000..7aa69899be0284d95a3654212f274af0c555fb1b Binary files /dev/null and "b/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 204513.png" differ diff --git "a/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 205502.png" "b/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 205502.png" new file mode 100644 index 0000000000000000000000000000000000000000..ccc64d777b021aa472ca4a08b634432a98c1fd2d Binary files /dev/null and "b/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 205502.png" differ diff --git "a/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 211723.png" "b/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 211723.png" new file mode 100644 index 0000000000000000000000000000000000000000..09f6b97c95274f7558c49d7839c0a4915c1be7f4 Binary files /dev/null and "b/\345\210\230\345\277\227\345\274\272/\345\261\217\345\271\225\346\210\252\345\233\276 2024-09-04 211723.png" differ