drop table projection;
drop table cinema;
drop table jouer;
drop table film;
drop table individu;

create table individu(
	num_ind number constraint pk_individu primary key,
	nom varchar2(30) NOT NULL,
	prenom varchar2(30) NOT NULL
);

create table film(
	num_film number constraint pk_film primary key,
	num_ind NOT NULL constraint fk_film references individu(num_ind),
	titre varchar2(60) NOT NULL,
	genre varchar2(20) DEFAULT 'Drame',
	annee number(4)
);

create table jouer(
	num_ind constraint fk1_jouer references individu(num_ind),
	num_film constraint fk2_jouer references film(num_film),
	role varchar2(30),
	constraint pk_jouer primary key (num_ind,num_film,role));

create table cinema(
	num_cine number constraint pk_cinema primary key,
	nom varchar2(30) NOT NULL,
	adresse varchar2(50));

create table projection(
	num_cine constraint fk1_projection references cinema(num_cine),
	num_film constraint fk2_projection references film(num_film),
	pdate date,
	constraint pk_projection primary key (num_cine,num_film,pdate)
);

