Population Census

Sort by

recency

|

1411 Discussions

|

  • + 0 comments
    SELECT
        SUM(a.POPULATION)
    FROM
        CITY AS a
        LEFT JOIN COUNTRY AS b
        ON UPPER(a.COUNTRYCODE) = UPPER(b.CODE)
    WHERE
        b.CONTINENT = 'Asia'
        
    
  • + 0 comments
    mssql
    
    SELECT SUM(cty.population) 
    FROM CITY cty WITH (NOLOCK)
    INNER JOIN COUNTRY ctry WITH (NOLOCK) 
    ON cty.COUNTRYCODE = ctry.CODE
    WHERE ctry.CONTINENT = 'ASIA'
    GROUP BY ctry.CONTINENT
    
  • + 1 comment

    ** With using Join **

    select sum(city.population) from city JOIN country on country.code = city.countrycode where country.continent='Asia';

    ** Without using Join **

    select sum(city.population) from city, country where country.continent='Asia' and city.countrycode = country.code;

  • + 0 comments

    select sum(city.population) from city left join country on CITY.CountryCode=COUNTRY.Code where continent="asia";

  • + 0 comments
    select
        sum(ct.population)
    from
        country cnt
    left join city ct on cnt.code = ct.countrycode
    where
        cnt.continent = 'Asia';