From 7d44352efc6d3397efda076f9a192130a383e065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=AD=90=E8=B1=AA?= <2936219414@qq.com> Date: Tue, 12 Sep 2023 17:12:07 +0800 Subject: [PATCH] zy --- .../9.12\344\275\234\344\270\232.md" | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 "54 \345\217\266\345\255\220\350\261\252/9.12\344\275\234\344\270\232.md" diff --git "a/54 \345\217\266\345\255\220\350\261\252/9.12\344\275\234\344\270\232.md" "b/54 \345\217\266\345\255\220\350\261\252/9.12\344\275\234\344\270\232.md" new file mode 100644 index 0000000..603755c --- /dev/null +++ "b/54 \345\217\266\345\255\220\350\261\252/9.12\344\275\234\344\270\232.md" @@ -0,0 +1,124 @@ +```mysql + +CREATE DATABASE aa; +use aa; +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2023-09-12 11:28:33 */ +/*==============================================================*/ + + +drop table if exists a; + +drop table if exists dianying; + +drop table if exists doubandianying; + +drop table if exists xieyingping; + +drop table if exists yanyuanxinxi; + +drop table if exists ²é¿´ÆÀÂÛ; + +/*==============================================================*/ +/* Table: a */ +/*==============================================================*/ +create table a +( + imdb_id varchar(20) not null, + IMDb varchar(20) not null, + dy_name varchar(20) not null, + primary key (imdb_id, IMDb) +); + +/*==============================================================*/ +/* Table: dianying */ +/*==============================================================*/ +create table dianying +( + IMDb varchar(20) not null, + wz varchar(20), + dy_name varchar(20) not null, + dy_lx varchar(20) not null, + zpgj varchar(20) not null, + dy_language varchar(20) not null, + sy_time date not null, + time time not null, + dy_ym varchar(20), + primary key (IMDb) +); + +/*==============================================================*/ +/* Table: doubandianying */ +/*==============================================================*/ +create table doubandianying +( + wz varchar(20) not null, + mc varchar(20) not null, + primary key (wz) +); + +/*==============================================================*/ +/* Table: xieyingping */ +/*==============================================================*/ +create table xieyingping +( + re_id int not null auto_increment, + IMDb varchar(20), + re_evaluate varchar(20) not null, + re_headline varchar(20) not null, + re_text varchar(999) not null, + primary key (re_id) +); + +/*==============================================================*/ +/* Table: yanyuanxinxi */ +/*==============================================================*/ +create table yanyuanxinxi +( + imdb_id varchar(20) not null, + name varchar(20) not null, + sex char(1) not null, + constellation varchar(20) not null, + birthday varchar(20) not null, + birthplace varchar(20) not null, + occupation varchar(20) not null, + more_name varchar(20) not null, + family varchar(20) not null, + introduction varchar(200) not null, + primary key (imdb_id) +); + +/*==============================================================*/ +/* Table: ²é¿´ÆÀÂÛ */ +/*==============================================================*/ +create table ²é¿´ÆÀÂÛ +( + re_id1 char(10) not null, + IMDb varchar(20), + re_evaluate varchar(20) not null, + re_name char(10) not null, + re_time char(10) not null, + re_text1 char(10) not null, + reply char(10) not null, + primary key (re_id1) +); + +alter table a add constraint FK_Relationship_2 foreign key (imdb_id) + references yanyuanxinxi (imdb_id) on delete restrict on update restrict; + +alter table a add constraint FK_Relationship_5 foreign key (IMDb) + references dianying (IMDb) on delete restrict on update restrict; + +alter table dianying add constraint FK_Relationship_1 foreign key (wz) + references doubandianying (wz) on delete restrict on update restrict; + +alter table xieyingping add constraint FK_Relationship_3 foreign key (IMDb) + references dianying (IMDb) on delete restrict on update restrict; + +alter table ²é¿´ÆÀÂÛ add constraint FK_Relationship_4 foreign key (IMDb) + references dianying (IMDb) on delete restrict on update restrict; + + +``` + -- Gitee