NULL error when adding a new line

2

Good people, I have a bank as described in the image below:

I have some questions:

A) Uma geladeira da marca Brastemp 220 V que custa R$ 700.
B) Três cadeiras de madeira em cores diferentes, cada uma custando R$ 53,40.

Response: INSERT INTO Produtos (descricao,marca,preco) VALUES ('Geladeira','BrasTemp',700) INSERT INTO Eletrodomesticos(voltagem) VALUES (220)

But this error is appearing in question A:

  

Msg 515, Level 16, State 2, Line 8   Can not insert the value NULL into column 'Type', table 'LOJAMIX.dbo.Products'; column does not allow nulls. INSERT fails.   The statement has been terminated.   Msg 515, Level 16, State 2, Line 9   Can not insert the value NULL into column 'CodBarra', table 'LOJAMIX.dbo.Eletrodomesticos'; column does not allow nulls. INSERT fails.   The statement has been terminated.

How do I resolve these errors?

    
asked by anonymous 05.12.2015 / 01:29

1 answer

3

Since the described columns can not be null and have no default value, you have to insert something. So:

INSERT INTO Produtos (descricao, marca, preco, Tipo) VALUES ('Geladeira', 'BrasTemp', 700, 'Eletro')
INSERT INTO Eletrodomesticos (voltagem, CodBarra) VALUES (220, '')
    
05.12.2015 / 01:36