T3 Softwares Interview Question

on database part SQL query