-2
I’m creating a DBA and I need to make one CHECK on an index of my table produto
, but I’m using Mysql and I’m having a problem with the syntax.
Follow the example:
CREATE TABLE produto(
Cod_produto int primary key not null,
nome_produto varchar(50) NOT NULL,
descricao text,
cod_tipoProduto int not null,
valor_Compra decimal (12,3) not null,
valor_Venda decimal (12,3) not null,
CONSTRAINT valorDeVenda CHECK valor_Venda IN (valor_Venda>= 0),
CONSTRAINT valorDeCompra CHECK valor_Compra IN (valor_Compra>=0)
);
Error
What problem are you having? Which error is being returned? Be more specific.
– Godfrey the King
I updated the error, with an image to be more specific
– Otávio Guilherme