i am designing a table for food industry application database. here is the code of a table in this database :
create table materialPriceAndStandard (
id int identity(200,1),
materialName nvarchar(100) not null default (0),
unitPrice decimal(19,2) not null default (0),
carbohydrate float not null default (0),
protein float not null default (0),
fat float not null default (0),
humidity float not null default (0),
minerals float not null default (0),
totalMinerals float not null
constraint PK_id_materialPriceAndStandard primary key (id)
);
materialPriceAndStandard table consist a series of materials, total amount of each row (sum of minerlas include : carbohydrate .... to minerlas) should not exceed or less than 100, is it possible to force the table to throw an error if the sum of materials become more or less that 100 at the time of insert ?