Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL and Python Data Work

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

Your question is SQL and Python Data Work. Start with the requirements and the two 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

Tell me about your experience using SQL and Python to solve data analysis problems.

For the hands-on SQL portion, use the provided users and analytics_events tables to summarize valid January 2025 activity for every user. Return one row per user, including users without qualifying events, and sort by total event value descending and user ID ascending.

Output

  1. Columns: user_id, user_name, qualifying_event_count, conversion_count, total_event_value, latest_event_at
  2. Include only January 2025 events with supported event types and nonnegative or NULL event values.

Schema

users
ColumnTypeDescription
user_idPKINTUnique user identifier
user_nameVARCHAR(100)User display name
emailVARCHAR(255)User email address
analytics_events
ColumnTypeDescription
event_idPKINTUnique event identifier
user_idINTUser associated with the event
occurred_atTIMESTAMPEvent timestamp
event_typeVARCHAR(50)Type of analytics event
channelVARCHAR(50)Acquisition or interaction channel
event_valueDECIMAL(10,2)Optional numeric value associated with the event
Tablesusersanalytics_events
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results