query: SELECT DISTINCT ?item ?itemLabel ?countryLabel ?area ?population WHERE {
    ?item wdt:P31/wdt:P279* wd:Q10864048 ; # first-level subdivision
          wdt:P17 ?country ;               # country
          p:P2046/psv:P2046 [              # area
            wikibase:quantityAmount ?baseArea;
            wikibase:quantityUnit [
              p:P2370/psv:P2370 [
                wikibase:quantityAmount ?unitArea;
                wikibase:quantityUnit wd:Q25343
              ]
            ]
          ] ;
          wdt:P1082 ?population .          # population
  
    BIND(ROUND(?baseArea * ?unitArea / 1000000) AS ?area) .
    FILTER ( ?area >= 400000 )
  
    FILTER NOT EXISTS { ?item wdt:P576 ?x }    # filter dissolved subdivisions
    FILTER NOT EXISTS { ?country wdt:P576 ?x } # filter dissolved countries
  
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
  }
  ORDER BY DESC(?area)