Pivot rotates a table by turning the unique values from one column into multiple columns in the output.
In this offering we will look at how to Pivot with BigQuery
You can access the code here https://gist.github.com/arunsark/9e5fb7b10ca77a62034c6b9e19396171