create table maticnaPloca(
idMaticna int unsigned not null auto_increment primary key,
nazivMaticna varchar(100) not null,
kolicinaMaticna int unsigned not null,
cena decimal
)type=InnoDB;
create table narudzba(
idNarudzba int unsigned not null auto_increment primary key,
idMaticna int unsigned not null ,
idHD int unsigned not null ,
idCdrom int unsigned not null ,
idNapajanje int unsigned not null ,
idCooler int unsigned not null ,
idRam int unsigned not null primary ,
primary key (idNarudzba),
foreign key (idMaticna) references maticnaPloca(idMaticna) on delete cascade on update cascade
)type=InnoDB;