query: SELECT ?ratio (COUNT(?item) AS ?count) WHERE {
    ?item wdt:P31/wdt:P279* wd:Q3305213 .
  
    ?item p:P2048/psv:P2048 [
      wikibase:quantityAmount ?baseHeight;
      wikibase:quantityUnit [
        p:P2370/psv:P2370 [
          wikibase:quantityAmount ?unitHeight;
          wikibase:quantityUnit wd:Q11573
        ]
      ]
    ].
    BIND(?baseHeight * ?unitHeight AS ?height).
  
    ?item p:P2049/psv:P2049 [
      wikibase:quantityAmount ?baseWidth;
      wikibase:quantityUnit [
        p:P2370/psv:P2370 [
          wikibase:quantityAmount ?unitWidth;
          wikibase:quantityUnit wd:Q11573
        ]
      ]
    ].
    BIND(?baseWidth * ?unitWidth AS ?width).
    
    BIND(?height / ?width AS ?r) .
    
    BIND(IF(?r<0.5,"< 0.5",
         IF(?r<0.6,"0.5 - 0.6",
         IF(?r<0.7,"0.6 - 0.7",
         IF(?r<0.8,"0.7 - 0.8",
         IF(?r<0.9,"0.8 - 0.9",
         IF(?r<1.0,"0.9 - 1.0",
         IF(?r<1.1,"1.0 - 1.1",
         IF(?r<1.2,"1.1 - 1.2",
         IF(?r<1.3,"1.2 - 1.3",
         IF(?r<1.4,"1.3 - 1.4",
         IF(?r<1.5,"1.4 - 1.5", "> 1.5"))))))))))) AS ?ratio) .
  
  }
  GROUP BY ?ratio
  ORDER BY DESC(?count)
  