Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Message Senders Without Voice Joins

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

Your question is Message Senders Without Voice Joins. Start with the requirements and the one table 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

You are given a Discord-style event log that records user actions across surfaces such as text chat and voice. Write a SQL query to return the users who have sent at least one message but have never joined a voice channel.

Use only the user_interactions table. Your result should include each qualifying user_id, the number of message events they generated, and be ordered by message count descending and then user_id ascending.

Schema

user_interactions
ColumnTypeDescription
interaction_idPKINTUnique interaction event ID
user_idINTUser who performed the interaction
event_typeVARCHAR(50)Interaction type such as message sent or voice channel joined
channel_idINTAssociated text or voice channel ID
event_tsTIMESTAMPTimestamp of the interaction
Tablesuser_interactions
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results