Tech Mahindra Interview Question

about SQL and some queries/scripts