I'm trying to define a subtype but I have no idea how, I've googled it but I didn't find anything concrete.
What I'm trying to do is build a netflix-like database which has movies and series.
So I have my "supertable" called "images" (didn't know how to word it better) which has the common data like the name, duration, etc... and then I want to define the subtype which is either a movie or a series.
Why? Because if it's a series I also need to keep track of the amount of seasons and episodes, and that's not necessary for a movie.
How can I do this? Any help is appreciated
Thanks in advance!
Edit: My create tables statement looks like this:
create table images(
imageID varchar(3),
name varchar(30) not null,
duration varchar(3) not null,
description varchar(255) not null,
IMDB varchar(3),
rating varchar(3),
castID varchar(3),
directorID varchar(3),
primary key (beeldID)
);
create table movies(
imageID varchar(3),
primary key (beeldID),
foreign key (beeldID) references beelden(beeldID)
);
create table series(
imageID varchar(3),
amountSeasons varchar(2) not null,
amountEpisodes varchar(2) not null,
primary key (beeldID),
foreign key (beeldID) references beelden(beeldID)
);
Would this work if I for example need to select all movies and compare the imageID from images and imageID from movies with eachother to be the same?