Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL and Python Data Work
00:00
5 left

SQL and Python Data Work

MediumSQL · PostgreSQL

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
Interviewer

Your question is SQL and Python Data Work. Start with the requirements and the two tables in the Question tab.

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.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.