Analytical Interview question at Amazon | Two CTE's and a Join | Question 8



Analytical Interview question at Amazon | Two CTE's and a Join | Question 8

Analytical Interview question at Amazon | Two CTE's and a Join | Question 8

In this video, I will solve an analytical interview question that was asked at Amazon. The question involves two different conditions that are solved in two different CTEs and are joined together to get the right output. I will walk you through the steps of solving the problem and explain the concepts behind the solution. This video is aimed at helping people prepare for analytics interviews.

MS SQL method by Ankit Bansal
https://www.youtube.com/watch?v=FNUIqQbj_EE

CREATE TABLE purchase_history (
userid INT,
productid INT,
purchasedate DATE
);

INSERT INTO purchase_history VALUES
(1,1,’2012-01-23′),
(1,2,’2012-01-23′),
(1,3,’2012-01-25′),
(2,1,’2012-01-23′),
(2,2,’2012-01-23′),
(2,2,’2012-01-25′),
(2,4,’2012-01-25′),
(3,4,’2012-01-23′),
(3,1,’2012-01-23′),
(4,1,’2012-01-23′),
(4,2,’2012-01-25′),
(6,2,’2012-01-25′),
(6,1,’2012-01-23′);

#interview #analytics #businessanalysis #product #swiggy #sql #bigquery #mysql #mocktest #union #string #split #substring #pivot #iterate #credit #debit #transaction #selfjoin #innerjoin #chatgpt #cred #subquery #monthly #retentions #concatenate #amazon #explained
#permanant #csk #dhoni #summer #vacation #2023

#analyticalinterview
#amazoninterview
#sql
#businesscasestudies
#rootcauseanalysis
#dataanalysis
#datascience
#analytics
#interviewquestions
#interviewprep
#interviewskills
#jobsearch
#careeradvice

Comments are closed.