Back to problems

Write SQL for last-7-day metrics without windows

SQL · ByteDance · Medium

Today's date is 2025-09-01. Two tables hold all the data you need, and every task below must be answered with exactly one ANSI SQL query. Ranking or window functions are banned; subqueries, joins, set operations, GROUP BY, HAVING and date arithmetic are all fair game. Multi-row results may come back in any order unless a task says otherwise. This exercise covers plain SQL analytics: distinct counting, grouped aggregates, join-based cohort logic, and conversion / retention…

Checking your access…