Sql Basic Hackerrank Solution For Python