Re: ERROR 1005: Can't create table (errno: 150) - Solved
first of all I checked the status of InnoDB, and the reason of the problem was that i tried to set null the fk on delete so i changed the query in this way
create table messaInScena
(
data date,
ora time,
spazio varchar(20),
spettacolo varchar(40),
postiDisponibili smallint,
prezzoIntero decimal(5,2),
prezzoRidotto decimal(5,2),
prezzoStudenti decimal(5,2),
primary key (data, ora, spazio),
foreign key (spazio) references spazio(nome)
on update cascade on delete cascade,
foreign key (spettacolo) references spettacolo(titolo)
on update cascade on delete cascade,
constraint RA3_1 check (postiDisponibili >= 0)
) ;
and execute it. now it's work.