Whova analysts need an event-level view of attendee engagement across published events. Write a PostgreSQL query that includes events with no registrations and separates results by attendee segment.
Requirements
- Analyze published events from January 1 through January 31, 2025, inclusive.
- Group results by event and user segment, counting registered users and users with attendance records.
- Calculate attendance rate, average minutes attended per session, and the number of users with at least 30 minutes attended.
- Preserve events with no registrations, displaying the segment as
No registrations, and sort by event date, event name, and segment.
Only registrations with registration_status = 'registered' should be included. Use 0 for metrics that cannot be calculated because no attendance exists.