Quantiphi interview question

Basic sql questions