Amazon interview question

Basic-average difficulty LeetCode SQL question