Want to ace your data science interview? 🚀 85% of successful candidates practice with real interview questions. Explore the ones companies actually ask: www.interviewquery.com/questions?
@tahakhalid3243 ай бұрын
Hi jay here is my solution, with next_positions as ( select id, start_date, end_date, user_id, position_name, lead(position_name,1,null) over(partition by user_id order by start_date) next_position from user_experiences ) , flags as ( select user_id, position_name, next_position, case when position_name = 'Data Analyst' and next_position = 'Data Scientist' then 1 else null end as flag_for_analyst from next_positions ) select (count(flag_for_analyst)/count(distinct user_id)) as percentage from flags