Answer: Computed columns are the columns that can be used to store the calculated
results based upon some other columns of the table
create table emptable
(eno int primary key,
ename varchar(10),
basic float,
hra float,
pf float,
gross as basic+hra+pf)
--gross is the computed column.
insert emptable values(100,'king',5000.77,500,200)
---------------------
select * from emptable
--output--
eno ename basic hra pf gross
100 king 5000.77 500 200 5700.77
--we cannot insert or update in a computed column
Asked In: Many Interviews |
Alert Moderator