Postgres Gallery: Create a gallery item that demonstrates a real life use case of a pivot table + SQL code for it.
We are trying to create a gallery of interesting uses of SQL that most people don't readily know. The repository for this gallery is located here: https://github.com/pavanagrawal123/PostgresGallery/
For this task, you will need to add an entry into our gallery.
Description of entry: Pivot tables are extremely helpful in spreadsheet based applications such as Excel or Google Sheets, but implementing them in SQL is not as easy as dragging and dropping some items. Write the SQL code needed to create a pivot table.
Check the README file in the Postgres Gallery repository on how to add a entry into the gallery, and submit a pull request on GitHub to complete this task.
In the PR you will need to include the following info:
1) A short description of the use 2) Sample code 3) Sample data
Your data should be representative of a real life use case, and your description should also match this.