Can You Solve Redfin’s SQL Puzzle?

Can You Solve Redfin’s SQL Puzzle?

🔄 StrataScratch Platform Updates

New & Updated Challenges!

📚 Recommended Reads by StrataScratch

Tired of Titanic? Try These 4 Data Projects Instead

Think AI-generated art, lyrical trends, and more. These creative ideas make your portfolio hard to forget. 👉 Read it here

More Picks Just for You:


🧠 Weekly Challenge

Redfin Wants Your SQL Skills: Update Call Duration

Redfin helps clients to find agents. Each client will have a unique request_id and each request_id has several calls. For each request_id, the first call is an “initial call” and all the following calls are “update calls”.  What's the average call duration for all update calls?

This SQL challenge from Redfin asks you to calculate the average duration of all update calls for each client request. You'll sharpen your skills in window functions, filtering ranked data, and aggregate calculations.

Approach Hints

To solve this SQL challenge on your own, consider these technical points:

  • Use the window function RANK() to rank calls within each request_id group.

  • Apply PARTITION BY request_id to ensure rankings reset for each client's request.

  • Order the rankings by created_on to correctly identify the first (initial) call.

  • Filter your ranked subquery to select only update calls (rk > 1).

  • Compute the average using the AVG() aggregate function on call_duration.

Take the challenge →


🌍 Latest from the Data Science Community

What’s Trending in the Data Science Community

🗣️ Got Feedback?

Help us improve!

Tell us how we can improve StrataScratch. Got ideas? We’re listening.

Take the 1-minute survey →

To view or add a comment, sign in

Others also viewed

Explore topics