UNPIVOT in SQL

The UNPIVOT operator in SQL performs the opposite of the PIVOT operator: it rotates columns into rows. It transforms columns that hold…