List high-impact in-progress incidents with the assigned user and department

Quick Overview

Write a SQL query that lists every high-impact incident still in progress, together with the assigned user's name, email and department. It tests multi-table joins along foreign keys, filtering on exact status values, and choosing between inner and left joins.

List high-impact in-progress incidents with the assigned user and department

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Other

Return every incident with `impact = 'High'` and `status = 'In Progress'`, along with the assigned user (found through `assigned_user_id`) and that user's department name. Output columns: `incident_id`, `title`, `impact`, `status`, `user_id`, `full_name`, `email`, `department_id`, `department_name`. Order by `incident_id` ascending. ```hint Map the columns first Write down which table each output column lives in, then follow the foreign keys from `incidents` to reach them. ``` ### Input Table(s) `incidents` | column | type | meaning | |---|---|---| | incident_id | INTEGER | Incident identifier | | title | VARCHAR | Short description of the incident | | impact | VARCHAR | One of 'High', 'Medium', 'Low' | | status | VARCHAR | One of 'Open', 'In Progress', 'Resolved', 'Closed' | | assigned_user_id | INTEGER | User the incident is assigned to | Primary key: `incident_id`. Foreign key: `assigned_user_id` references `users.user_id`. `users` | column | type | meaning | |---|---|---| | user_id | INTEGER | User identifier | | full_name | VARCHAR | User's full name | | email | VARCHAR | User's email address | | department_id | INTEGER | Department the user belongs to | Primary key: `user_id`. Foreign key: `department_id` references `departments.department_id`. `departments` | column | type | meaning | |---|---|---| | department_id | INTEGER | Department identifier | | department_name | VARCHAR | Department name | Primary key: `department_id`. ### Output Contract | column | type | meaning | |---|---|---| | incident_id | INTEGER | The incident | | title | VARCHAR | Incident title | | impact | VARCHAR | Always 'High' in the result | | status | VARCHAR | Always 'In Progress' in the result | | user_id | INTEGER | The assigned user | | full_name | VARCHAR | Assigned user's full name | | email | VARCHAR | Assigned user's email | | department_id | INTEGER | Assigned user's department | | department_name | VARCHAR | Name of that department | One row per matching incident, ordered by `incident_id` ascending. `incident_id` is unique, so the order is fully determined. No rounding applies. ### Example `incidents` | incident_id | title | impact | status | assigned_user_id | |---|---|---|---|---| | 1 | VPN gateway down | High | In Progress | 101 | | 2 | Email delivery delays | Medium | In Progress | 102 | | 3 | Payroll export failing | High | Open | 103 | | 4 | Core switch packet loss | High | In Progress | 103 | | 5 | Printer offline | Low | Resolved | 102 | | 6 | SSO login errors | High | In Progress | 102 | `users` | user_id | full_name | email | department_id | |---|---|---|---| | 101 | Priya Shah | priya.shah@example.com | 1 | | 102 | Tom Becker | tom.becker@example.com | 2 | | 103 | Lena Ortiz | lena.ortiz@example.com | 1 | `departments` | department_id | department_name | |---|---| | 1 | Network Operations | | 2 | Service Desk | Expected output: | incident_id | title | impact | status | user_id | full_name | email | department_id | department_name | |---|---|---|---|---|---|---|---|---| | 1 | VPN gateway down | High | In Progress | 101 | Priya Shah | priya.shah@example.com | 1 | Network Operations | | 4 | Core switch packet loss | High | In Progress | 103 | Lena Ortiz | lena.ortiz@example.com | 1 | Network Operations | | 6 | SSO login errors | High | In Progress | 102 | Tom Becker | tom.becker@example.com | 2 | Service Desk | Incident 2 is in progress but has Medium impact, incident 3 is High but still Open, and incident 5 fails both filters. The three remaining incidents pick up their assignee's name, email and department. ### Constraints and Clarifications - Row counts: `incidents` at most 10,000, `users` at most 1,000, `departments` at most 100. - `impact` is one of 'High', 'Medium', 'Low' and `status` is one of 'Open', 'In Progress', 'Resolved', 'Closed', stored with exactly that spelling and casing. - `assigned_user_id` is never NULL and always references a valid `users.user_id`. - Every user belongs to one department: `users.department_id` is never NULL and always references a valid `departments.department_id`. - Each incident has exactly one assignee, so no incident can appear twice in the result.

Overview: Write a SQL query that lists every high-impact incident still in progress, together with the assigned user's name, email and department. It tests multi-table joins along foreign keys, filtering on exact status values, and choosing between inner and left joins.

General logo
General
Nov 25, 2026
easyData ScientistOtherData Manipulation (SQL/Python)
0
0

Return every incident with impact = 'High' and status = 'In Progress', along with the assigned user (found through assigned_user_id) and that user's department name. Output columns: incident_id, title, impact, status, user_id, full_name, email, department_id, department_name. Order by incident_id ascending.

Input Table(s)

incidents

columntypemeaning
incident_idINTEGERIncident identifier
titleVARCHARShort description of the incident
impactVARCHAROne of 'High', 'Medium', 'Low'
statusVARCHAROne of 'Open', 'In Progress', 'Resolved', 'Closed'
assigned_user_idINTEGERUser the incident is assigned to

Primary key: incident_id. Foreign key: assigned_user_id references users.user_id.

users

columntypemeaning
user_idINTEGERUser identifier
full_nameVARCHARUser's full name
emailVARCHARUser's email address
department_idINTEGERDepartment the user belongs to

Primary key: user_id. Foreign key: department_id references departments.department_id.

departments

columntypemeaning
department_idINTEGERDepartment identifier
department_nameVARCHARDepartment name

Primary key: department_id.

Output Contract

columntypemeaning
incident_idINTEGERThe incident
titleVARCHARIncident title
impactVARCHARAlways 'High' in the result
statusVARCHARAlways 'In Progress' in the result
user_idINTEGERThe assigned user
full_nameVARCHARAssigned user's full name
emailVARCHARAssigned user's email
department_idINTEGERAssigned user's department
department_nameVARCHARName of that department

One row per matching incident, ordered by incident_id ascending. incident_id is unique, so the order is fully determined. No rounding applies.

Example

incidents

incident_idtitleimpactstatusassigned_user_id
1VPN gateway downHighIn Progress101
2Email delivery delaysMediumIn Progress102
3Payroll export failingHighOpen103
4Core switch packet lossHighIn Progress103
5Printer offlineLowResolved102
6SSO login errorsHighIn Progress102

users

user_idfull_nameemaildepartment_id
101Priya Shahpriya.shah@example.com1
102Tom Beckertom.becker@example.com2
103Lena Ortizlena.ortiz@example.com1

departments

department_iddepartment_name
1Network Operations
2Service Desk

Expected output:

incident_idtitleimpactstatususer_idfull_nameemaildepartment_iddepartment_name
1VPN gateway downHighIn Progress101Priya Shahpriya.shah@example.com1Network Operations
4Core switch packet lossHighIn Progress103Lena Ortizlena.ortiz@example.com1Network Operations
6SSO login errorsHighIn Progress102Tom Beckertom.becker@example.com2Service Desk

Incident 2 is in progress but has Medium impact, incident 3 is High but still Open, and incident 5 fails both filters. The three remaining incidents pick up their assignee's name, email and department.

Constraints and Clarifications

  • Row counts: incidents at most 10,000, users at most 1,000, departments at most 100.
  • impact is one of 'High', 'Medium', 'Low' and status is one of 'Open', 'In Progress', 'Resolved', 'Closed', stored with exactly that spelling and casing.
  • assigned_user_id is never NULL and always references a valid users.user_id .
  • Every user belongs to one department: users.department_id is never NULL and always references a valid departments.department_id .
  • Each incident has exactly one assignee, so no incident can appear twice in the result.