Pivot the Occupation column in OCCUPATIONS so that each Name is sorted alphabetically and displayed underneath its corresponding Occupation. The output should consist of four columns (Doctor, Professor, Singer, and Actor) in that specific order, with their respective names listed alphabetically under each column.
Note
Print NULL when there are no more names corresponding to an occupation.
The OCCUPATIONS table is described as follows:
| Field | Type |
|---|---|
| Name | String |
| Occupation | String |
Occupation will only contain one of the following values:
Doctor,Professor,SingerorActor.