Servian interview question

Sql hackerrank easy medium and hard