Hi folks, just wanna share a few sql questions I had on a recent Amazon Data Scientist phone interview
there are 2 tables: STREAMS and TITLES
STREAMS table
USER_ID
TITLE_ID
STREAM_TIMESTART
STREAM_MINUTES
Key for this table is (USER_ID,TITLE_ID,STREAM_TIMESTART)
TITLES table
TITLE_ID
GENRE
NAME
LAUNCH_DATE
Key for this table is TITLE_IDjoin and group byUSER_ID and date(STREAM_TIMESTART) and order by STREAM_TIMESTART here, taking row_number()==1.join with a filter LAUNCH_DATE + INTERVAL 28 DAYS >= date(STREAM_TIMESTART) here but the interviewer did not seemed to like/understand this approach and kept asking me for an alternative approach. I guess he found it unintuitive? Anyone else got another idea please?