Your question is SQL Sorting by Last Name. Start with the requirements and the three tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Retool administrators need a consistently organized member list for the Support Operations workspace. Write a PostgreSQL query that returns eligible workspace members and sorts their names by last name.
Support Operations workspace.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique user identifier |
| first_name | VARCHAR(50) | User's first name |
| last_name | VARCHAR(50) | User's last name |
| account_status | VARCHAR(20) | Current account state |
| Column | Type | Description |
|---|---|---|
| workspace_idPK | INTEGER | Unique workspace identifier |
| workspace_name | VARCHAR(100) | Workspace display name |
| Column | Type | Description |
|---|---|---|
| membership_idPK | INTEGER | Unique membership identifier |
| workspace_id | INTEGER | Referenced workspace |
| user_id | INTEGER | Referenced user |
| membership_status | VARCHAR(20) | Current membership state |
| role | VARCHAR(30) | Role within the workspace |