Usaully database contains tables having static columns to hold the data. However, there may be case when values of certain column are calculated by expression from other columns. In such there is no need of physical storage of data for those columns. Such columns are defined as virtual columns to calculate values on the fly.
Syntax for colum definition:
column_name [data_type] [GENERATED ALWAYS] AS (expression) [VIRTUAL]
Suppose we have “employee” table as in below.
