From b0996fd0297d228d1e7a45aebff319f7a16eefa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=8C?= <280180014@qq.com> Date: Tue, 12 Sep 2023 04:57:42 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=BB=BA=2020230911?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "15 \345\220\264\346\226\214/20230911/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "15 \345\220\264\346\226\214/20230911/.keep" diff --git "a/15 \345\220\264\346\226\214/20230911/.keep" "b/15 \345\220\264\346\226\214/20230911/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From be5320fe3346835674c698639873ebea915f1c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=8C?= <280180014@qq.com> Date: Tue, 12 Sep 2023 04:58:05 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E5=90=B4=E6=96=8C=E7=9A=84=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴斌 <280180014@qq.com> --- .../20230911 \346\227\245\345\277\227.md" | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 "15 \345\220\264\346\226\214/20230911/20230911 \346\227\245\345\277\227.md" diff --git "a/15 \345\220\264\346\226\214/20230911/20230911 \346\227\245\345\277\227.md" "b/15 \345\220\264\346\226\214/20230911/20230911 \346\227\245\345\277\227.md" new file mode 100644 index 0000000..1818f19 --- /dev/null +++ "b/15 \345\220\264\346\226\214/20230911/20230911 \346\227\245\345\277\227.md" @@ -0,0 +1,185 @@ +# 日志 + +## 九月十一日 + +☀天 + +今天主要是加强了对一对多和多对多的概念 + +# 代码 + +```MySQL +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2023/9/12 11:07:20 */ +/*==============================================================*/ +create database film charset utf8; +use film; + +drop table if exists actor; + +drop table if exists audience; + +drop table if exists awards; + +drop table if exists movie; + +drop table if exists recommend; + +drop table if exists score; + +drop table if exists type; + +/*==============================================================*/ +/* Table: actor */ +/*==============================================================*/ +create table actor +( + ac_id int not null, + mv_id int not null, + ac_position varchar(10) not null, + ac_name varchar(10) not null, + ac_sex varchar(3) not null, + ac_introduce varchar(30) not null, + primary key (ac_id) +); + +/*==============================================================*/ +/* Table: audience */ +/*==============================================================*/ +create table audience +( + aud_id int not null, + mv_id int not null, + aud_name varchar(10) not null, + aud_score numeric(2,1) not null, + aud_comment varchar(50) not null, + primary key (aud_id) +); + +/*==============================================================*/ +/* Table: awards */ +/*==============================================================*/ +create table awards +( + awa_id int not null, + mv_id int not null, + awa_name varchar(10) not null, + primary key (awa_id) +); + +/*==============================================================*/ +/* Table: movie */ +/*==============================================================*/ +create table movie +( + mv_id int not null, + type_id int not null, + mv_name varchar(10) not null, + mv_language varchar(5) not null, + mv_duration time not null, + publish date not null, + state varchar(10) not null, + mv_introduce varchar(100) not null, + primary key (mv_id) +); + +/*==============================================================*/ +/* Table: recommend */ +/*==============================================================*/ +create table recommend +( + rec_id char(10) not null, + mv_id int not null, + rec_name char(10) not null, + primary key (rec_id) +); + +/*==============================================================*/ +/* Table: score */ +/*==============================================================*/ +create table score +( + mv_id int not null, + grade float not null +); + +/*==============================================================*/ +/* Table: type */ +/*==============================================================*/ +create table type +( + type_id int not null, + type_name varchar(5) not null, + primary key (type_id) +); + +alter table actor add constraint FK_actor foreign key (mv_id) + references movie (mv_id) on delete restrict on update restrict; + +alter table audience add constraint FK_see foreign key (mv_id) + references movie (mv_id) on delete restrict on update restrict; + +alter table awards add constraint FK_bear foreign key (mv_id) + references movie (mv_id) on delete restrict on update restrict; + +alter table movie add constraint FK_type foreign key (type_id) + references type (type_id) on delete restrict on update restrict; + +alter table recommend add constraint FK_recommend foreign key (mv_id) + references movie (mv_id) on delete restrict on update restrict; + +alter table score add constraint FK_score2 foreign key (mv_id) + references movie (mv_id) on delete restrict on update restrict; + +insert into type (type_id, type_name) +values (1,'爱情'),(2,'动作'),(3,'搞笑'),(4,'热血'),(5,'玄幻'); + +insert into movie (mv_id, type_id, mv_name, mv_language, mv_duration, publish, state, mv_introduce) +values (1,1,'坤坤爱上小黑子','汉语','02:25:50','2023-09-11','中国','一个机缘巧合之下,篮球明星坤坤遇到了一个让他迷恋的女孩,而这个女孩居然是个小黑子'), + (2,2,'坤拳','汉语','01:45:30','2023-09-01','中国','少年做了一个奇怪的梦,梦里有一个会唱跳rap篮球的人在做着奇怪的动作,当少年想要过去时梦醒了,少年发现自己学会了失传已久的坤拳'), + (3,3,'变相怪杰','英语','01:41:00','1994-07-29','美国','老实本分的银行小职员,过着和普通人一样的生活,一晚,他意外得到一个奇怪的面具,他的生活就发生了奇妙的变化'), + (4,4,'犯罪都市','韩语','01:41:20','2017-10-03','韩国','韩国刑警们展开扫荡暴力作战行动,将新兴犯罪组织一网打尽'), + (5,5,'我居然重生成了坤坤','汉语','02:15:26','2023-09-07','中国','我重生了,但我好像变成了一个篮球明星,这次我要靠着这个身份走上巅峰'); + +insert into score (mv_id, grade) +values (1,9.9),(2,9.7),(3,8.0),(4,7.7),(5,9.8); + +insert into audience (aud_id, mv_id, aud_name, aud_score, aud_comment) +values (1,1,'你要我怎么荔枝',9.9,'这个小黑子真幸福,我也想跟坤坤谈一场甜甜的恋爱'), + (2,1,'你食不食油饼',9.9,'我是真爱粉,鸽鸽的电影必须高分'), + (3,2,'小鸡子露出黑脚了吧',9.8,'坤拳好强,我也要修炼坤拳,扬善除恶'), + (4,2,'鸽鸽下的蛋黑子不许吃',9.7,'自幼学习武术,但看了影片感觉连坤拳一招都挡不住'), + (5,3,'爱琴海',8.0,'觉得绿面具很恐怖,小时候确实留下很深的印象'), + (6,4,'63',7.8,'一拳昏迷,两拳打醒,三拳自己见上帝'), + (7,5,'坤坤我爱你',9.9,'重生的坤坤也好帅,鸽鸽天下第一帅'), + (8,5,'哎哟你干嘛',9.7,'虽然跟坤坤有些不一样,但坤坤的精神是独一无二的'); + +insert into recommend (rec_id, mv_id, rec_name) +values (1,1,'坤坤的篮球之旅'), + (2,2,'坤坤一路的风景'), + (3,3,'冒牌天神'), + (4,4,'犯罪都市2'), + (5,5,'唱跳没有想象中的简单'); + +insert into actor (ac_id, mv_id, ac_position, ac_name, ac_sex, ac_introduce) +values (1,1,'导演','坤坤总部大队长','未知','这个人很神秘,但他肯定是个真爱粉'), + (2,1,'主演','坤坤','男','不用过多介绍,就是我们的鸽鸽'), + (3,2,'导演','坤坤总部大队长','未知','这个人很神秘,但他肯定是个真爱粉'), + (4,2,'主演','坤坤','男','不用过多介绍,就是我们的鸽鸽'), + (5,3,'导演','查克·拉塞尔','男','美国演员,主要影片有变相怪杰,面具等'), + (6,3,'主演','金·凯瑞','男','被称为好莱坞的周星驰,很可惜患上了严重的抑郁症'), + (7,3,'女主','卡梅隆·迪亚兹','女','金发撩人,蓝色的双眸深情迷魂'), + (8,4,'导演','姜允成','男','凭借电影犯罪都市获得54届百想艺术大赏最佳新人导演奖提名'), + (9,4,'主演','马东锡','男','曾获得第33届韩国青龙电影奖,被大家称为韩国的最后一个男人'), + (10,5,'导演','坤坤总部大队长','未知','这个人很神秘,但他肯定是个真爱粉'), + (11,5,'主演','坤坤迷弟','男','长相酷似坤坤,是坤坤的忠实粉丝'); + +insert into awards (awa_id, mv_id, awa_name) +values (1,1,'一坤惊人奖'), + (2,2,'武术巅峰奖'), + (3,3,'奥斯卡金像奖'), + (4,4,'第54届百想艺术大赏'), + (5,5,'奥斯卡金坤奖'); +``` + -- Gitee