Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL Summary of Meeting Engagement

HardSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL Summary of Meeting Engagement. Start with the requirements and the four tables on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

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

  1. Analyze published events from January 1 through January 31, 2025, inclusive.
  2. Group results by event and user segment, counting registered users and users with attendance records.
  3. Calculate attendance rate, average minutes attended per session, and the number of users with at least 30 minutes attended.
  4. 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.

Schema

events
ColumnTypeDescription
event_idPKINTUnique Whova event identifier
event_nameVARCHAR(150)Event name
event_dateDATEScheduled event date
statusVARCHAR(20)Publication status
users
ColumnTypeDescription
user_idPKINTUnique user identifier
user_nameVARCHAR(100)User display name
segmentVARCHAR(30)Business or attendee segment
registrations
ColumnTypeDescription
registration_idPKINTUnique registration identifier
event_idINTRegistered event identifier
user_idINTRegistered user identifier
registration_statusVARCHAR(20)Registration state
attendance
ColumnTypeDescription
attendance_idPKINTUnique attendance record identifier
registration_idINTRegistration associated with the session
session_nameVARCHAR(100)Attended meeting or session
minutes_attendedINTMinutes attended in the session
Tableseventsusersregistrationsattendance
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results