#716

Active users on a given date

Skypro sells online data-analyst courses and each morning the dashboard shows how many students are currently in active learning. Every enrollment carries an enrollment_period of type DATERANGE — start date inclusive, end date exclusive ('[)'). Table user_courses: - user_id — student id - course_id — course id - enrollment_period DATERANGE — access window Count how many distinct students had at least one active enrollment period covering 2024-04-15. Each student is counted once even if they have several active courses at the same time.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

active_users
6
Skypro

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid