Image by pixabay.com

User Activity Analysis In SQL

A common SQL problem solution and code walkthrough

Olga Berezovsky
Data Analysis Journal
4 min readApr 16, 2021

--

Getting user activity stats is a common SQL question that often is asked during technical interviews. It’s somewhere between an intermediate and an advanced level — analyzing user activity by applying SQL rank function.

Let’s assume that we have a table called user_activity with the following columns:

--

--