Work Anniversary

ASKED IN INTERVIEW
2pts
Linked In

Problem Statement

LinkedIn wants to send automated "Congratulations on 5 years!" notifications to users. To qualify, a user must have started their current position exactly 5 years ago relative to the current month.

Write an SQL query to find all users celebrating their 5th work anniversary in February 2026.

Rules:

  • The start_date must be in February 2021 (since 2026 - 5 = 2021).
  • Output columns: user_id, full_name, start_date.
  • Sort the results by start_date in ascending order.

Table Schema:

  • UserProfiles: user_id, full_name, start_date (DATE).
Tests your understanding of
Basic SQL, DateTime and Filtering

Input Tables

UserProfiles
user_id(INTEGER)full_name(VARCHAR)start_date(DATE)
1Alice Smith2021-02-15
2Bob Jones2021-02-01
3Charlie Brown2021-03-01
4David Miller2020-02-10
5Eve Adams2021-02-28
6Frank White2022-02-11

Expected Output

user_id(INTEGER)full_name(VARCHAR)start_date(DATE)
2Bob Jones2021-02-01
1Alice Smith2021-02-15
5Eve Adams2021-02-28

Tags

EasyASKED IN INTERVIEWBasic SQLDateTimeFiltering
10-15 min
70%

Hints