I'm learning PostgreSQL and I'm wondering is it possible to add a derived column to a table then ALTER it on a another line, I've tried different ways but I can't find the correct Syntax for it.
For some reason its seems as if the exercise wants it on two lines, but I can only do it on one at the moment.
-- 1) Add an attribute Taxes to table Payment
ALTER TABLE Payment
ADD Taxes real;
-- 2) Set the derived attribute taxes as 12% of PaySlip
ALTER TABLE Payment
ALTER COLUMN Taxes AS (0.12*Payment.PaySlip);