Altimetrik Interview Question

Basically they asked about the SQL