Neal Analytics interview question

1 SQL query and 2 programming questions