If you want to learn the basics of SQL analytics function, first read SQL analytic functions interview questions – Part 1 | SQL analytic functions interview questions – Part 2 | SQL analytic functions interview questions – Part 3
Given the below data:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
event_id event_type city country duration_seconds ---------------------------------------------------------------------- 1 login sydney australia 9 2 logout melbourne australia 8 3 login sydney australia 5 4 login melbourne australia 9 5 login california usa 8 6 logout new york usa 6 7 login california usa 5 8 login new york usa 2 |
Q1.
…