CREATE TABLE country
(
    country_id       INTEGER not null
            primary key,
    country_iso_code TEXT  default NULL,
    country_name     TEXT default NULL
);
country
CREATE TABLE department
(
    department_id   INTEGER not null
            primary key,
    department_name TEXT default NULL
);
department
CREATE TABLE gender
(
    gender_id INTEGER not null
            primary key,
    gender    TEXT default NULL
);
gender
CREATE TABLE genre
(
    genre_id   INTEGER not null
            primary key,
    genre_name TEXT default NULL
);
genre
CREATE TABLE keyword
(
    keyword_id   INTEGER not null
            primary key,
    keyword_name TEXT default NULL
);
keyword
CREATE TABLE language
(
    language_id   INTEGER not null
            primary key,
    language_code TEXT  default NULL,
    language_name TEXT default NULL
);
language
CREATE TABLE language_role
(
    role_id       INTEGER not null
            primary key,
    language_role TEXT default NULL
);
language_role
CREATE TABLE movie
(
    movie_id    INTEGER not null
            primary key,
    title        TEXT  default NULL,
    budget       INTEGER            default NULL,
    homepage     TEXT  default NULL,
    overview     TEXT  default NULL,
    popularity   REAL default NULL,
    release_date DATE           default NULL,
    revenue      INTEGER     default NULL,
    runtime      INTEGER           default NULL,
    movie_status TEXT    default NULL,
    tagline      TEXT  default NULL,
    vote_average REAL  default NULL,
    vote_count   INTEGER            default NULL
);
movie
CREATE TABLE movie_genres
(
    movie_id INTEGER default NULL,
    genre_id INTEGER default NULL,
    foreign key (genre_id) references genre(genre_id),
    foreign key (movie_id) references movie(movie_id)
);
movie_genres
CREATE TABLE movie_languages
(
    movie_id         INTEGER default NULL,
    language_id      INTEGER default NULL,
    language_role_id INTEGER default NULL,
    foreign key (language_id) references language(language_id),
    foreign key (movie_id) references movie(movie_id),
    foreign key (language_role_id) references language_role(role_id)
);
movie_languages
CREATE TABLE person
(
    person_id   INTEGER not null
            primary key,
    person_name TEXT default NULL
);
person
CREATE TABLE movie_crew
(
    movie_id      INTEGER          default NULL,
    person_id     INTEGER          default NULL,
    department_id INTEGER          default NULL,
    job           TEXT default NULL,
    foreign key (department_id) references department(department_id),
    foreign key (movie_id) references movie(movie_id),
    foreign key (person_id) references person(person_id)
);
movie_crew
CREATE TABLE production_company
(
    company_id   INTEGER not null
            primary key,
    company_name TEXT default NULL
);
production_company
CREATE TABLE production_country
(
    movie_id   INTEGER default NULL,
    country_id INTEGER default NULL,
    foreign key (country_id) references country(country_id),
    foreign key (movie_id) references movie(movie_id)
);
production_country
CREATE TABLE movie_cast
(
    movie_id       INTEGER          default NULL,
    person_id      INTEGER          default NULL,
    character_name TEXT default NULL,
    gender_id      INTEGER          default NULL,
    cast_order     INTEGER       default NULL,
    foreign key (gender_id) references gender(gender_id),
    foreign key (movie_id) references movie(movie_id),
    foreign key (person_id) references person(person_id)
);
movie_cast
CREATE TABLE "movie_keywords"
(
    movie_id   INTEGER default NULL
        references movie,
    keyword_id INTEGER default NULL
        references keyword
);
movie_keywords
CREATE TABLE "movie_company"
(
    movie_id   INTEGER default NULL
        references movie,
    company_id INTEGER default NULL
        references production_company
);
movie_company
original_column_name,column_name,column_description,data_format,value_description
movie_id,movie id,"the id of the movie
Maps to movie(movie_id)",integer,
person_id,person id,"the id of the person
Maps to person(person_id)",integer,
character_name,character name,the character name,text,
gender_id,gender id,"the id of the cast's gender
Maps to gender(gender_id)",integer,
cast_order,cast order,the cast order of the cast,integer,"commonsense evidence:
The cast order of a movie or television show refers to the sequence in which the actors and actresses are listed in the credits. This order is typically determined by the relative importance of each actor's role in the production, with the main actors and actresses appearing first, followed by the supporting cast and extras. "
movie_cast
original_column_name,column_name,column_description,data_format,value_description
language_id,language id,the unique identifier of the language,integer,
language_code,language code,the code of the language,text,"commonsense evidence:
Here we use ISO 639 codes to identify the language. "
language_name,language name,the language name,text,
language
original_column_name,column_name,column_description,data_format,value_description
genre_id,genre id,the unique identifier of the genre,integer,
genre_name,,the genre,text,
genre
original_column_name,column_name,column_description,data_format,value_description
department_id,department id,the unique identifier of the department,integer,
department_name,department name,the name of the department,,
department
original_column_name,column_name,column_description,data_format,value_description
movie_id,mivie id,the unique identifier of the movie,integer,
country_id,country id,the id of the country,integer,
production_country
original_column_name,column_name,column_description,data_format,value_description
movie_id,movie id,"the id of the movie 
Maps to movie(movie_id)",integer,
language_id,language id,"the id of the movie language
Maps to language(language_id)",integer,
language_role_id,language role id,the id of the role's language,integer,
movie_languages
original_column_name,column_name,column_description,data_format,value_description
gender_id,gender id,the unique identifier of the gender,integer,
gender,,the gender,text,"commonsense evidence:
female/ male/ unspecified "
gender
original_column_name,column_name,column_description,data_format,value_description
movie_id,movie id,"the id of the movie 
Maps to movie(movie_id)",integer,
company_id,company id,"the id of the company that produced the movie
Maps to production_company(company_id)",integer,"commonsense evidence:
If movies with different movie_id have the same company_id, it means these movies were made by the same company. "
movie_company
original_column_name,column_name,column_description,data_format,value_description
keyword_id,keyword id,the unique identifier of the keyword,integer,
keyword_name, keyword name,the keyword,text,
keyword
original_column_name,column_name,column_description,data_format,value_description
movie_id,movie id,"the id of the movie that the crew worked for
Maps to movie(movie_id)",integer,
person_id,person id,"the id of the crew
Maps to person(person_id)",integer,
department_id,department id,"the id of the crew's department
Maps to department(department_id)",integer,
job,,the job of the crew,text,"commonsense evidence:
A movie may involve several crews with the same job title. "
movie_crew
original_column_name,column_name,column_description,data_format,value_description
movie_id,movie id,"the id of the movie 
Maps to movie(movie_id)",integer,
genre_id,genre id,"the id of the movie genre
Maps to genre(genre_id)",integer,
movie_genres
original_column_name,column_name,column_description,data_format,value_description
movie_id,movie id,"the id of the movie 
Maps to movie(movie_id)",integer,
keyword_id,keyword id,"the id of the movie keyword
Maps to keyword(keyword_id)",integer,"commonsense evidence:
A movie may have many keywords. Audience could get the genre of the movie according to the movie keywords. "
movie_keywords
original_column_name,column_name,column_description,data_format,value_description
movie_id,movie id,the unique identifier of the movie,integer,
title,,the title of the movie,text,
budget,,the budget for the movie,integer,"commonsense evidence:
If a movie has higher popularity, it means that it is well-liked by a large number of people. This can be determined by looking at the movie's ratings and reviews, as well as the box office performance and overall buzz surrounding the film. Higher popularity often translates to more success for the movie, both financially and critically."
homepage,,the homepage of the movie,text,
overview,,the overview of the movie,text,
popularity,,the popularity of the movie,real,"commonsense evidence:
If a movie has higher popularity, it means that it is well-liked by a large number of people. This can be determined by looking at the movie's ratings and reviews, as well as the box office performance and overall buzz surrounding the film. Higher popularity often translates to more success for the movie, both financially and critically."
release_date,release date,the release date of the movie,date,
revenue,,the revenue of the movie,integer,"commonsense evidence:
A higher vote average indicates that a greater proportion of people who have seen the movie have given it positive ratings."
runtime,,the runtime of the movie,integer,
movie_status,,"the status of the movie
The only value of this column is 'Released'. ",text,
tagline,,the tagline of the movie,text,
vote_average,vote average,the average vote for the movie,real,"commonsense evidence:
A higher vote average indicates that a greater proportion of people who have seen the movie have given it positive ratings."
vote_count,vote count ,the vote count for the movie,integer,"commonsense evidence:
If a movie has a higher vote average and vote count, it means that it has been well-received by audiences and critics. A higher vote count means that more people have rated the movie, which can indicate a greater level of interest in the film."
movie
original_column_name,column_name,column_description,data_format,value_description
country_id,country id,the unique identifier of the country,integer,
country_iso_code,country iso code,the ISO code,text,"commonsense evidence:
ISO codes are typically used to identify countries and their subdivisions, and there are different types of ISO codes depending on the specific application. Here we use ISO 3166 code to identify countries. "
country_name,country name,the name of the country,text,
country
original_column_name,column_name,column_description,data_format,value_description
company_id,company id,the unique identifier of the company,integer,
company_name,company name,the name of the company,text,
production_company
original_column_name,column_name,column_description,data_format,value_description
person_id,person id,the unique identifier of the person,integer,
person_name,person name,the name of the person,text,
person
original_column_name,column_name,column_description,data_format,value_description
role_id,role id,the unique identifier of the language id,integer,
language_role,language role,the language role,text,"commonsense evidence:
In the context of language roles in a movie or other audio-visual production, ""original"" and ""spoken"" refer to the languages in which the movie was originally produced, and the languages spoken by the characters in the movie, respectively."
language_role