Session Difference
Start Timer
0:00:00
Given a table of user sessions, write a query to get the number of days between each user’s first session and last session for the year 2020.
Example:
Input:
user_sessions
table
Column | Type |
---|---|
session_id |
INTEGER |
created_at |
DATETIME |
user_id |
INTEGER |
Output:
Column | Type |
---|---|
user_id |
INTEGER |
no_of_days |
INTEGER |
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments
This feature requires a user account
Sign up to join a community of 150K+ data scientists.
Access 1000+ data science interview questions
30,000+ top company interview guides
Unlimited code runs and submissions
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est
quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est