ActionIQ interview question

SQL, data structure