SQL: Human Traffic of Stadium

Medium
SQL — Advanced SQL Self Join Consecutive
Find 3+ consecutive rows with >= 100 visitors.

Constraints

Write standard SQL (MySQL 8.0 compatible).

Examples

Example 1:
Input: id visitors 1 120 2 130 3 90 4 110 5 150 6 200
Output:
Example 2:
Input: id visitors 1 120 2 130 3 90 4 110 5 150 6 200
Output:

Hints

Self-join on consecutive IDs.
▲ Console

Install Talent Arabia

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