Cracking SQL Interview Questions: User System Response Times Explained

  Рет қаралды 2,722

Jay Feng

Jay Feng

Күн бұрын

Пікірлер: 2
@iqjayfeng
@iqjayfeng 2 ай бұрын
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?
@tahakhalid324
@tahakhalid324 2 ай бұрын
Hi Jay thanks for posting, Here is my solution to the question: with conversation_messages_users as ( SELECT cm.id as id_1, cm.created_at as created_at, cm.updated_at as updated_at, cm.text, cm.message_type, cm.interview_id, coalesce(i.user_id,0) as user_id FROM conversation_messages cm left join interviews i on cm.interview_id = i.id ) , prev_responses as ( SELECT user_id, message_type, created_at, lag(created_at,1,0)over(partition by user_id order by created_at) prev_creat, lag(message_type,1,0)over(partition by user_id order by created_at) prev_mesg from conversation_messages_users order by created_at ) SELECT user_id, avg(TIMESTAMPDIFF(SECOND, prev_creat, created_at)) AS response_times FROM prev_responses WHERE message_type = 'user' AND prev_mesg= 'system' group by user_id
Can You Find Hulk's True Love? Real vs Fake Girlfriend Challenge | Roblox 3D
00:24
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 6 МЛН
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 9 МЛН
10 recently asked Pyspark Interview Questions | Big Data Interview
28:36
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 1,2 МЛН
Can You Find Hulk's True Love? Real vs Fake Girlfriend Challenge | Roblox 3D
00:24