Slack's security team wants to review active channels that include people from outside the organization. For every non-archived channel, assign an exposure label based on its number of external guests: - `High Exposure` for 10 or more external guests. - `Review` for 1 to 9 external guests. - `Internal Only` for zero external guests. A NULL external-guest count should be treated as zero. Return only non-archived channels. Return the columns in this exact order: `channel_id`, `channel_name`, `external_guest_count`, and `exposure_label`. Sort by `external_guest_count` descending, then `channel_id` descending. ### Table Schema | Table | Column | Type | |---|---|---| | `workspace_channels` | `channel_id` | integer | | `workspace_channels` | `channel_name` | varchar(80) | | `external_guest_count` | `external_guest_count` | integer | | `workspace_channels` | `member_count` | integer | | `workspace_channels` | `is_archived` | boolean | | `workspace_channels` | `created_at` | timestamp | ### Example Input: `workspace_channels` | channel_id | channel_name | external_guest_count | member_count | is_archived | created_at | |---:|---|---:|---:|---|---| | 1 | customer-launch | 12 | 40 | false | 2025-01-01 09:00:00 | | 2 | vendor-sync | 4 | 15 | false | 2025-01-02 09:00:00 | | 3 | engineering | 0 | 80 | false | 2025-01-03 09:00:00 | | 4 | old-partners | 20 | 30 | true | 2025-01-04 09:00:00 | | 5 | design-review | NULL | 25 | false | 2025-01-05 09:00:00 | ### Example Output Explanation `customer-launch` is labeled `High Exposure` because it has 12 external guests. `vendor-sync` is labeled `Review` because it has 4 external guests. `engineering` and `design-review` are labeled `Internal Only`; the NULL value for `design-review` is treated as zero. `old-partners` is excluded because it is archived.
DROP TABLE IF EXISTS workspace_channels; CREATE TABLE workspace_channels ( channel_id INT, channel_name VARCHAR(80), external_guest_count INT, member_count INT, is_archived BOOLEAN, created_at TIMESTAMP ); INSERT INTO workspace_channels VALUES (1,'customer-launch',12,40,FALSE,'2025-01-01 09:00:00'), (2,'vendor-sync',4,15,FALSE,'2025-01-02 09:00:00'), (3,'engineering',0,80,FALSE,'2025-01-03 09:00:00'), (4,'old-partners',20,30,TRUE,'2025-01-04 09:00:00'), (5,'design-review',NULL,25,FALSE,'2025-01-05 09:00:00');