SQL: Active Users

Medium
SQL — Advanced SQL DATE Window Functions
Find users active on 5+ consecutive days.

Constraints

Write standard SQL (MySQL 8.0 compatible).

Examples

Example 1:
Input: user_id date 1 2024-01-01 1 2024-01-02...
Output:
Example 2:
Input: user_id date 1 2024-01-01 1 2024-01-02...
Output:

Hints

Date manipulation with self-join or window functions.
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.