0
I wrote the following code for the college database class:
CREATE DATABASE estoque;
USE estoque;
CREATE TABLE produtos( /*o erro ocorre aqui nesse parêntese*/
INT codP,
CHAR (20) nomeP,
FLOAT precoP,
PRIMARY KEY (codP)
FOREIGN KEY (id)
);
CREATE TABLE fornecedores( /*e nesse parêntese*/
INT id,
CHAR (40) nomeF,
PRIMARY KEY (id),
FOREIGN KEY (codP)
);
However, there are syntax errors where I commented. And even searching manuals on websites or in the documentation itself, they’re written the same way I wrote them, so I don’t know how to fix them and there’s no way to give origin to that code.
Review your FOREIGN KEY clauses. Which field is referencing which field in which table?
– anonimo