How do I build a two-column SQL view?

Create a SQL view in MySQL Workbench that converts a wide table into two columns: one for the field name and one for its corresponding value.

CREATE VIEW transformed_view AS
SELECT 'first_name' AS col_label, first_name AS col_value FROM customers
UNION ALL
SELECT 'email', email FROM customers;

In developing a similar solution, I found that using multiple SELECT clauses combined with UNION ALL in the CREATE VIEW statement is both an effective and flexible method for restructuring data. This approach allows each original column to be redefined as a pair of label and value, streamlining data analysis for reporting or pivoting tasks. Additionally, careful column naming facilitates maintenance and future extensions. This method proved reliable on several projects, even when new columns were introduced, by merely appending extra unioned SELECT statements.