Quantiphi interview question

sql concepts