FPT Software Interview Question

solve a sql problem and DSA