sql - Sqlzoo SELECT within SELECT Tutorial #5 -


my question is:

germany (population 80 million) has largest population of countries in europe. austria (population 8.5 million) has 11% of population of germany.

show name , population of each country in europe. show population percentage of population of germany.

my answer:

select name,concat(round(population/80000000,-2),'%') world population = (select population                     world                       continent='europe') 

what doing wrong? thanks.

the question incomplete , taken here

this answer

select    name,    concat(round((population*100)/(select population                                   world name='germany'), 0), '%') world population in (select population                      world                      continent='europe') 

i wondering sub-query op's question wasn't clear (at least me). reason "world" table (as name suggest, have admit) contains world country whereas we're interested european one. moreover, population of germany has retrieved db because it's not extacly 80.000.000; if use number receive 101% germany population.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -