From 226023c430c10d1c18d46e89e09c254d3b469067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?22=20=E8=82=96=E9=92=9F=E5=87=AF=E9=9F=A9?= <3175644391@qq.com> Date: Tue, 12 Sep 2023 23:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=BA=94=E6=AC=A1=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...65\345\275\261\344\277\241\346\201\257.md" | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 "22 \350\202\226\351\222\237\345\207\257\351\237\251/20230912 \347\224\265\345\275\261\344\277\241\346\201\257.md" diff --git "a/22 \350\202\226\351\222\237\345\207\257\351\237\251/20230912 \347\224\265\345\275\261\344\277\241\346\201\257.md" "b/22 \350\202\226\351\222\237\345\207\257\351\237\251/20230912 \347\224\265\345\275\261\344\277\241\346\201\257.md" new file mode 100644 index 0000000..cbff1f6 --- /dev/null +++ "b/22 \350\202\226\351\222\237\345\207\257\351\237\251/20230912 \347\224\265\345\275\261\344\277\241\346\201\257.md" @@ -0,0 +1,151 @@ +今天没有什么笔记,写一点自己的感受 + +通过上周写的图书馆管理系统er图,到今天的电影信息er图,明显的感觉到了比刚开始写的时候思路、表与表之间的关系都更加清晰了,所以还是得多看、多写、多练。 + +## 作业 + +~~~ mysql +create database movie charset utf8; +use movie; + +/*==============================================================*/ +/* Table: commentary */ +/*==============================================================*/ +create table commentary +( + commentary_id int not null auto_increment, + user_id int not null, + movie_id int not null, + commentary varchar(255) not null, + primary key (commentary_id) +); + +/*==============================================================*/ +/* Table: language */ +/*==============================================================*/ +create table language +( + language_id int not null auto_increment, + language_name char(5) not null, + primary key (language_id) +); + +/*==============================================================*/ +/* Table: movie */ +/*==============================================================*/ +create table movie +( + movie_id int not null auto_increment, + type_id int not null, + region_id int not null, + language_id int not null, + movie_name varchar(20) not null, + movie_duration int not null, + movie_release int not null, + movie_briefing varchar(255) not null, + primary key (movie_id) +); + +/*==============================================================*/ +/* Table: movie2cast */ +/*==============================================================*/ +create table movie2cast +( + participant_id char(10) not null, + movie_id int not null, + actor_name char(10) not null, + primary key (participant_id, movie_id) +); + +/*==============================================================*/ +/* Table: movie2participant */ +/*==============================================================*/ +create table movie2participant +( + participant_id char(10) not null, + movie_id int not null, + director_name char(10) not null, + primary key (participant_id, movie_id) +); + +/*==============================================================*/ +/* Table: movie2scriptwriter */ +/*==============================================================*/ +create table movie2scriptwriter +( + participant_id char(10) not null, + movie_id int not null, + scriptwriter_name char(10) not null, + primary key (participant_id, movie_id) +); + +/*==============================================================*/ +/* Table: participant */ +/*==============================================================*/ +create table participant +( + participant_id char(10) not null, + participant_name char(10) not null, + participant_gender char(1) not null, + participant_age int not null, + participant_briefing varchar(255) not null, + primary key (participant_id) +); + +/*==============================================================*/ +/* Table: recommend */ +/*==============================================================*/ +create table recommend +( + recommend_id int not null auto_increment, + recommend_name char(10) not null, + primary key (recommend_id) +); + +/*==============================================================*/ +/* Table: region */ +/*==============================================================*/ +create table region +( + region_id int not null auto_increment, + region_name char(5) not null, + primary key (region_id) +); + +/*==============================================================*/ +/* Table: score */ +/*==============================================================*/ +create table score +( + movie_id int not null, + user_id int not null, + score int not null, + primary key (movie_id, user_id) +); + +/*==============================================================*/ +/* Table: type */ +/*==============================================================*/ +create table type +( + type_id int not null auto_increment, + type_name char(5) not null, + primary key (type_id) +); + +/*==============================================================*/ +/* Table: user */ +/*==============================================================*/ +create table user +( + user_id int not null auto_increment, + recommend_id int not null, + user_name char(6) not null, + user_gende char(1) not null, + user_age int not null, + user_area char(2) not null, + primary key (user_id) +); +~~~ + +![img](https://s2.loli.net/2023/09/12/qTD9dupAHtnIWUR.png) \ No newline at end of file -- Gitee