CAST expression is used to convert one data type to another. It is similar to the various field-type functions (e.g.…