ION Group interview question

Oops, DBMS, SQL, puzzles, case study