Loading...

Upvote Percentage by Age Cohort

A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
hard

Problem

Classify each user as 'new' if julianday(MAX signup_date in users) - julianday(their signup_date) <= 30, otherwise 'existing'. A successful search is a search_queries row where clicked_result = 1. Per segment, return segment, total_searches, successful_searches, and success_rate = successful / total (decimal). Sort alphabetically by segment.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.