At the time of executing the error query stating that it is not possible to create the foreign keys, I looked in the documentation and did not understand whether this code is possible or not.
create table autor(
cod_autor integer,
nome varchar(50) NOT NULL,
nascimento date NOT NULL,
primary key(cod_autor)
);
create table editora(
cod_editora int,
razao text,
endereco varchar(50),
cnpj int NOT NULL UNIQUE,
cidade varchar(40),
primary key(cod_editora)
);
create table livro(
titulo varchar (100),
cd_autor integer NOT NULL,
cd_editora integer,
valor float NOT NULL,
publicacao DATE not null,
volume INTEGER NOT NULL,
primary key (titulo,cd_autor),
foreign key(cd_autor) references autor(cd_autor) ON UPDATE SET NULL ON DELETE SET NULL,
foreign key (cd_editora) references autor(cd_autor) ON UPDATE SET NULL ON DELETE SET NULL
);
Error:
Can not add foreign key constraint