Search ⌘K
Google
Google

Foundations Track · Medium · 25 min

2078 From Microsoft To Google

WITH employers_cte AS ( SELECT *, LEAD(employer) OVER(PARTITION BY user_id ORDER BY start_date) as next_employer FROM linkedin_users ) SELECT COUNT(DISTINCT ...

Foundations Track
Medium
25 min
filtering
aggregation

Company labels are directional practice context, not official interview guidance.

Timer 00:00
Back to practice

Objective

Practice filtering through a Google-tagged business scenario.

Approach

Use this track to lock in clean query structure, basic filtering logic, and confidence with grouped output.

Company context

Company labels are directional practice context, not official interview guidance.

Prereq: query basics
Prereq: filtering

WITH employers_cte AS ( SELECT *, LEAD(employer) OVER(PARTITION BY user_id ORDER BY start_date) as next_employer FROM linkedin_users ) SELECT COUNT(DISTINCT user_id) AS employee_count FROM employers_cte WHERE employer='Microsoft' AND next_employer='Google'

Pro question
This is a Pro question

Upgrade to Pro to unlock this prompt, the SQL workspace, and all 254 problems.

Upgrade to Pro — unlock all 254 problems
Editor
SQL workspace

Run queries against the protected question data, then submit once the result shape looks right.

Sign in to run SQL

Create a free account or sign in before running queries against protected question data.