Sql Basic Hackerrank Solution In Python