HCLTech Interview Question

2 medium level and 1 hard code. 2 SQL queries.