diff --git "a/58 \351\231\210\350\203\234\346\235\260/2023-05-08.md" "b/58 \351\231\210\350\203\234\346\235\260/2023-09-08.md" similarity index 100% rename from "58 \351\231\210\350\203\234\346\235\260/2023-05-08.md" rename to "58 \351\231\210\350\203\234\346\235\260/2023-09-08.md" diff --git "a/58 \351\231\210\350\203\234\346\235\260/2023-09-12.md" "b/58 \351\231\210\350\203\234\346\235\260/2023-09-12.md" new file mode 100644 index 0000000000000000000000000000000000000000..1e7707dea56e22eb516743bb9e6f690cfc85e0ba --- /dev/null +++ "b/58 \351\231\210\350\203\234\346\235\260/2023-09-12.md" @@ -0,0 +1,137 @@ +![屏幕截图 2023-09-12 225416](C:\Users\陈胜杰\Pictures\Screenshots\屏幕截图 2023-09-12 225416.png) + +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2023/9/12 22:48:17 */ +/*==============================================================*/ +create DATABASE movie character set utf8; +use movie; + +drop table if exists act_in; + +drop table if exists actor; + +drop table if exists discuss; + +drop table if exists file_review; + +drop table if exists film; + +drop table if exists phrase; + +drop table if exists user; + +/*==============================================================*/ +/* Table: act_in */ +/*==============================================================*/ +create table act_in +( + ac_id decimal not null, + film_id decimal not null, + primary key (ac_id, film_id) +); + +/*==============================================================*/ +/* Table: actor */ +/*==============================================================*/ +create table actor +( + ac_id decimal not null, + ac_name varchar(20) not null, + ac_english_name varchar(20) not null, + imb varchar(20) not null, + ְac_work varchar(10) not null, + ac_sex char(1) not null, + ac_intro text not null, + ac_head_portrait varchar(100) not null, + primary key (ac_id) +); + +/*==============================================================*/ +/* Table: discuss */ +/*==============================================================*/ +create table discuss +( + user_id decimal not null, + film_id decimal not null, + ds_headline varchar(30) not null, + ds_discuss varchar(300) not null, + primary key (user_id, film_id) +); + +/*==============================================================*/ +/* Table: file_review */ +/*==============================================================*/ +create table file_review +( + user_id decimal not null, + film_id decimal not null, + fr_headline varchar(30), + fr_fr varchar(300), + primary key (user_id, film_id) +); + +/*==============================================================*/ +/* Table: film */ +/*==============================================================*/ +create table film +( + film_id decimal not null, + film_name char(20) not null, + film_english char(20) not null, + film_release_date date not null, + film_alias varchar(100) not null, + imdb varchar(100) not null, + film_review text not null, + primary key (film_id) +); + +/*==============================================================*/ +/* Table: phrase */ +/*==============================================================*/ +create table phrase +( + user_id decimal not null, + film_id decimal not null, + ph_state varchar(10) not null, + ph_lable varchar(100) not null, + ph_critic varchar(350) not null, + primary key (user_id, film_id) +); + +/*==============================================================*/ +/* Table: user */ +/*==============================================================*/ +create table user +( + user_id decimal not null, + user_pw varchar(20) not null, + user_sex char(1) not null, + user_address varchar(50) not null, + user_head_protrait varchar(100) not null, + primary key (user_id) +); + +alter table act_in add constraint FK_Relationship_3 foreign key (ac_id) + references actor (ac_id) on delete restrict on update restrict; + +alter table act_in add constraint FK_Relationship_9 foreign key (film_id) + references film (film_id) on delete restrict on update restrict; + +alter table discuss add constraint FK_Relationship_10 foreign key (film_id) + references film (film_id) on delete restrict on update restrict; + +alter table discuss add constraint FK_Relationship_4 foreign key (user_id) + references user (user_id) on delete restrict on update restrict; + +alter table file_review add constraint FK_Relationship_12 foreign key (film_id) + references film (film_id) on delete restrict on update restrict; + +alter table file_review add constraint FK_Relationship_6 foreign key (user_id) + references user (user_id) on delete restrict on update restrict; + +alter table phrase add constraint FK_Relationship_11 foreign key (film_id) + references film (film_id) on delete restrict on update restrict; + +alter table phrase add constraint FK_Relationship_5 foreign key (user_id) + references user (user_id) on delete restrict on update restrict; \ No newline at end of file