SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Longest Login Streaks

Unsolved

Meta's growth team is studying habit formation. A login streak is a run of consecutive calendar days on which a user logged in at least once. A user may log in several times on the same day, and streaks can cross month boundaries. Write an SQL query that returns every user whose longest streak is at least 3 days, with columns `user_id` and `longest_streak` (the length in days of that user's longest streak). Order the results by `longest_streak` descending, then `user_id` ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Meta🏢 Snap

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM user_logins
Full source dataset
15 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine