The table regional_targets has the columns region, jan, feb, mar and apr, with exactly one row per region. Some monthly target cells are null because those targets have not been set yet. You must reshape the data for a machine learning pipeline. The result must meet all of these requirements:
- The output columns are
region,monthandtarget_amount, with one row per region per month. - Months whose target is null must still appear as rows.
- The
monthvalues must beJanuary,February,MarchandApril.
Which two queries meet all the requirements? Each correct answer presents a complete solution. Select two.
Reshaping wide monthly columns into rows is an unpivot. UNPIVOT drops null values unless INCLUDE NULLS is added, so that keyword is needed to keep months with unset targets. In the clause, the column named before FOR receives the values and the column after FOR receives the source column names, and an alias on each listed column changes the label stored in the name column. Only the two queries that combine all three elements meet every requirement.