CREATE TABLE tw_theater
.movie
(
id
VARCHAR(20) NOT NULL,
title
VARCHAR(45) NOT NULL,
original_title
VARCHAR(45) NOT NULL,
alt
VARCHAR(45) NOT NULL,
year
YEAR(4) NOT NULL,
image
VARCHAR(45) NOT NULL,
rate
DOUBLE NOT NULL,
PRIMARY KEY (id
));
CREATE TABLE tw_theater
.movie
(
id
VARCHAR(20) NOT NULL,
title
VARCHAR(45) NOT NULL,
original_title
VARCHAR(45) NOT NULL,
alt
VARCHAR(45) NOT NULL,
year
YEAR(4) NOT NULL,
image
VARCHAR(45) NOT NULL,
rate
DOUBLE NOT NULL,
PRIMARY KEY (id
));
CREATE TABLE tw_theater
.director
(
id
INT NOT NULL,
movie_id
VARCHAR(45) NOT NULL,
film_maker_id
VARCHAR(45) NOT NULL,
PRIMARY KEY (id
));
CREATE TABLE tw_theater
.actor
(
id
INT NOT NULL,
movie_id
VARCHAR(45) NOT NULL,
film_maker_id
VARCHAR(45) NOT NULL,
PRIMARY KEY (id
));
CREATE TABLE tw_theater
.genre
(
id
INT NOT NULL AUTO_INCREMENT,
name
VARCHAR(45) NOT NULL,
PRIMARY KEY (id
));
ALTER TABLE tw_theater
.director
CHANGE COLUMN id
id
INT(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE tw_theater
.actor
CHANGE COLUMN id
id
INT(11) NOT NULL AUTO_INCREMENT ;
CREATE TABLE tw_theater
.movie_genre
(
id
INT NOT NULL AUTO_INCREMENT,
movie_id
VARCHAR(45) NOT NULL,
genre_id
VARCHAR(45) NOT NULL,
PRIMARY KEY (id
));
CREATE TABLE tw_theater
.comment
(
id
VARCHAR(20) NOT NULL,
movie_id
VARCHAR(45) NOT NULL,
author
VARCHAR(45) NOT NULL,
rate
DOUBLE NOT NULL,
content
VARCHAR(200) NOT NULL,
create_at
DATETIME(8) NOT NULL,
PRIMARY KEY (id
));
CREATE TABLE film_maker
(
id
varchar(20) NOT NULL,
name
varchar(45) NOT NULL,
image
varchar(45) NOT NULL,
alt
varchar(45) NOT NULL,
film_makercol
varchar(45) NOT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
网友评论