Average Population

  • + 0 comments

    SELECT FLOOR(AVG(population)) AS AveragePopulation FROM city;

    FLOOR: "Always rounds down!!" to the nearest whole number, which aligns with the requirement to round down. example: 1234.567 becomes 1234 because it’s the integer part of the number, ignoring the decimal portion.

    ROUND: Rounds to the nearest integer based on standard rounding rules (0.5 and above rounds up, below 0.5 rounds down), which does not specifically ensure rounding down. example: 1234.567 becomes 1235 because it’s closer to 1235.