Altimetrik interview question

Basically they asked about the SQL