The Question
SQLAlphabetical Continent Pivot
Given a table
Student containing name and continent columns (with potential duplicates), pivot the table so that student names are grouped under their respective continent headers: 'America', 'Asia', and 'Europe'. Within each column, names must be sorted alphabetically. If one continent has more students than another, the extra rows for the smaller continents should be filled with NULL. The result should show the first alphabetical student for each continent in the first row, the second in the second row, and so on.PostgreSQL
Window Function
CTE
Conditional Aggregation
FILTER Clause