Servian Interview Question

Sql hackerrank easy medium and hard