This could be done in several ways. You could define a trigger making the calculation and storing the result or you could not store the result at all but create a view which would do the calculation. But perhaps the simplest solution would be to use a computed column.
Consider the following
CREATE TABLE CalcTest (
A int,
B int,
C AS A-B
);
INSERT INTO CalcTest (A, B) VALUES (2,1);
INSERT INTO CalcTest (A, B) VALUES (1,1);
INSERT INTO CalcTest (A, B) VALUES (1,2);
INSERT INTO CalcTest (A, B) VALUES (NULL,1);
INSERT INTO CalcTest (A, B) VALUES (1,NULL);
INSERT INTO CalcTest (A, B) VALUES (NULL,NULL);
SELECT * FROM CalcTest;
The result of the SELECT query would be
A B C
---- ---- ----
2 1 1
1 1 0
1 2 -1
NULL 1 NULL
1 NULL NULL
NULL NULL NULL