-- drop table reservation;
-- drop table movie;

create table movie(mid integer, 
	title char(40),
	type char(10),
	primary key (mid)); 

create table reservation(id integer,
	mid   integer,
	when  date,
      	primary key (id, mid), 
 	foreign key (id) references students(id),
 	foreign key (mid) references movie(mid));	

insert into movie values(1, 'a ', 'action');
insert into movie values(2, 'b ', 'fiction');
insert into movie values(3, 'c ', 'action');
insert into movie values(4, 'd ', 'romance');
insert into movie values(5, 'e ', 'commedie');
insert into movie values(6, 'f ', 'fiction');

insert into reservation values(111111111, 1, to_date('01/01/2005','MM/DD/YYYY'));
insert into reservation values(111111111, 6, to_date('01/03/2005','MM/DD/YYYY'));
insert into reservation values(222222222, 1, to_date('01/05/2005','MM/DD/YYYY'));
insert into reservation values(222222222, 4, to_date('01/05/2005','MM/DD/YYYY'));
insert into reservation values(333333333, 5, to_date('01/05/2005','MM/DD/YYYY'));
