Population Density Difference

  • + 0 comments

    MYSQL SOLUTION Approch 1

    SELECT ABS((SELECT POPULATION FROM CITY ORDER BY POPULATION DESC LIMIT 1) - (SELECT POPULATION FROM CITY ORDER BY POPULATION ASC LIMIT 1)) FROM CITY LIMIT 1
    

    Approch 2

    SELECT (MAX(POPULATION) - MIN(POPULATION)) FROM CITY;