From bc4138ff9ac84b75d62f9f95e7843ed2b9c77b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E6=AD=A3=E6=B3=A2?= <1938448998@qq.com> Date: Tue, 12 Sep 2023 19:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=9D=E6=9C=88=E5=8D=81=E4=BA=8C=E6=97=A5?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...56\345\272\223\351\253\230\347\272\247.md" | 187 ++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 "09 \346\233\271\346\255\243\346\263\242/20230912 \346\225\260\346\215\256\345\272\223\351\253\230\347\272\247.md" diff --git "a/09 \346\233\271\346\255\243\346\263\242/20230912 \346\225\260\346\215\256\345\272\223\351\253\230\347\272\247.md" "b/09 \346\233\271\346\255\243\346\263\242/20230912 \346\225\260\346\215\256\345\272\223\351\253\230\347\272\247.md" new file mode 100644 index 0000000..ecc63b3 --- /dev/null +++ "b/09 \346\233\271\346\255\243\346\263\242/20230912 \346\225\260\346\215\256\345\272\223\351\253\230\347\272\247.md" @@ -0,0 +1,187 @@ +# 笔记 + +2023年9月12日 天晴 心情一般! + +# 作业 + + + +```mysql +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2023/9/12 17:37:52 */ +/*==============================================================*/ +create database movie charset utf8; +use movie; + +drop table if exists Directorinformation; + +drop table if exists address; + +drop table if exists audience; + +drop table if exists booklist; + +drop table if exists film; + +drop table if exists filmreview; + +drop table if exists introq; + +drop table if exists language; + +drop table if exists phrase; + +drop table if exists type; + +/*==============================================================*/ +/* Table: Directorinformation */ +/*==============================================================*/ +create table Directorinformation #详细信息 +( + d_id int not null, + i_id int not null, + d_name varchar(5) not null, + d_sex char(2) not null, + d_age varchar(3) not null, + d_add varchar(50) not null, + primary key (d_id) +); + +/*==============================================================*/ +/* Table: address */ +/*==============================================================*/ +create table address #地址 +( + a_id int not null, + f_id int not null, + a_name varchar(5) not null, + primary key (a_id) +); + +/*==============================================================*/ +/* Table: audience */ +/*==============================================================*/ +create table audience #观众 +( + a_ticketnumber int not null, + f_id int not null, + a_name varchar(5) not null, + a_phone char(11) not null, + primary key (a_ticketnumber) +); + +/*==============================================================*/ +/* Table: booklist */ +/*==============================================================*/ +create table booklist #书单 +( + bo_id int not null, + a_ticketnumber int not null, + bo_list varchar(10) not null, + bo_recommend varchar(50) not null, + primary key (bo_id) +); + +/*==============================================================*/ +/* Table: film */ +/*==============================================================*/ +create table film #电影信息 +( + f_id int not null, + f_name varchar(10) not null, + f_date date not null, + f_time time not null, + primary key (f_id) +); + +/*==============================================================*/ +/* Table: filmreview */ +/*==============================================================*/ +create table filmreview #影评 +( + fi_id int not null, + f_id int not null, + fi_class int not null, + fi_headline varchar(10) not null, + fi_content varchar(100) not null, + primary key (fi_id) +); + +/*==============================================================*/ +/* Table: introq */ +/*==============================================================*/ +create table introq #简介 +( + i_id int not null, + f_id int not null, + i_director varchar(5) not null, + i_scriptwriter varchar(20) not null, + i_protagonist varchar(50) not null, + i_score decimal(3,1) not null, + primary key (i_id) +); + +/*==============================================================*/ +/* Table: language */ +/*==============================================================*/ +create table language #语言 +( + l_id int not null, + f_id int not null, + l_name varchar(10) not null, + primary key (l_id) +); + +/*==============================================================*/ +/* Table: phrase */ +/*==============================================================*/ +create table phrase#短评 +( + p_id int not null, + f_id int not null, + p_content varchar(100) not null, + primary key (p_id) +); + +/*==============================================================*/ +/* Table: type */ +/*==============================================================*/ +create table type #类型 +( + t_modelcodet int not null, + f_id int not null, + t_name varchar(5) not null, + primary key (t_modelcodet) +); + +alter table Directorinformation add constraint FK_indetail foreign key (i_id) + references introq (i_id) on delete restrict on update restrict; + +alter table address add constraint FK_e foreign key (f_id) + references film (f_id) on delete restrict on update restrict; + +alter table audience add constraint FK_watch foreign key (f_id) + references film (f_id) on delete restrict on update restrict; + +alter table booklist add constraint FK_g foreign key (a_ticketnumber) + references audience (a_ticketnumber) on delete restrict on update restrict; + +alter table filmreview add constraint FK_a foreign key (f_id) + references film (f_id) on delete restrict on update restrict; + +alter table introq add constraint FK_include foreign key (f_id) + references film (f_id) on delete restrict on update restrict; + +alter table language add constraint FK_h foreign key (f_id) + references film (f_id) on delete restrict on update restrict; + +alter table phrase add constraint FK_b foreign key (f_id) + references film (f_id) on delete restrict on update restrict; + +alter table type add constraint FK_f foreign key (f_id) + references film (f_id) on delete restrict on update restrict; + + +``` + -- Gitee