LTM Limited Interview Question

code using map and filter, sql queries