1
Q

ROW_NUMBER() OVER(PARTITION BY user_id ORDER BY event_time)

A

Find first/last event;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

LAG() / LEAD()

A

Session gap, churn detection;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SUM(x) OVER(ORDER BY date)

A

Cumulative metrics;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

DENSE_RANK()

A

Ranking with ties (e.g. top product categories);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

COUNT(DISTINCT …)

A

Unique users, sessions;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Nested CASE WHEN

A

Conditional metrics;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

“for each,” “per,” “every”

A

GROUP BY or PARTITION BY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

“total,” “count,” “average,” “sum”

A

Aggregate functions (COUNT(), AVG(), etc.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

“most recent,” “latest,” “top 3,” “best”

A

ROW_NUMBER() or RANK() (Window Function)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

“and see their…” (e.g., posts and see their reactions)

A

LEFT JOIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

“that also have” (e.g., posts that also have ‘heart’ reactions)

A

INNER JOIN or WHERE EXISTS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

“users with more than 10 posts” (filtering on an aggregate)

A

HAVING clause

How well did you know this?
1
Not at all
2
3
4
5
Perfectly