SQL

Step 2 of 9 in Data Science · Build · Easy

SQL queries tables: filter, join, group and aggregate. Window functions (ROW_NUMBER, LAG) handle rankings and time comparisons.

Build it

  1. Top 3 per category

    In SQLite, return the top 3 products by revenue in each category with ROW_NUMBER() OVER (PARTITION BY …).

    Done when: Correct on a 50-row table including ties.

  2. Retention cohorts

    From events(user_id, date), output signup month × months since signup with % active.

    Done when: Month 0 is 100% for every cohort.

Resources

Earn this star

On the map, you log what you built. Finish the step and its star lights.

Open this step on the map