Some time ago I stumbled into this video on youtube with an interesting SQL quiz (they claim it is interview question by FAANG company). Solution from the video contains a number of subqueries and joins however none of that is actually needed. Let me show you how this can be solved with a single table scan.
Continue reading “SQL Interview Question by a FAANG company”