drop table pc;
drop table portables;
drop table imprimantes;
drop table produits;

create table produits(
constructeur char not null,
modele int not null,
type varchar2(10) not null,
primary key (modele),
check (type='pc' or type='laptop' or type='printer')
);

create table pc(
modele int not null,
vitesse float not null,
ram int not null,
hd float not null,
cd char(3) not null,
prix float not null,
primary key (modele),
foreign key (modele) references produits (modele)
);

create table portables(
modele int not null,
vitesse float not null,
ram int not null,
hd float not null,
ecran float not null,
prix float not null,
primary key (modele),
foreign key (modele) references produits (modele)
);

create table imprimantes(
modele int not null,
couleur int not null,
type varchar2(10) not null,
prix float not null,
primary key (modele),
foreign key (modele) references produits (modele),
check (couleur=0 or couleur=1),
check (type='ink-jet' or type='laser' or type='dry')
);

