SQL · Airbnb · Easy
A website records page views in a table named page_events with the following columns: Every row corresponds to one page view that happened inside a user's session. For any given page view, its dwell time is the amount of time that elapses between that row's event_time and the event_time of the event that immediately follows it within the same session_id. Write a SQL query whose result has exactly these columns, in this order: where dwell_seconds is the dwell time of that…