title: SQL combined SELECT statement
body: <p>This is actually from an interactive site SQLzoo.net which I was using to brush up my SQL knowledge.</p>
  
  <p>The problem is </p>
  
  <blockquote>
    <p>Find the continents where all countries have a population &lt;= 25000000. Then find the names of the countries associated with these continents. Show name, continent and population.</p>
  </blockquote>
  
  <p>What I have done to produce the solution</p>
  
  <pre><code>SELECT name, continent, population 
  FROM world x 
  WHERE population &lt;= ALL(SELECT population 
                          FROM world y 
                          WHERE y.continent = x.continent 
                            AND population &gt; 25000000)
  </code></pre>
  
  <p>I didn't want to copy and edit the output as it is extremely tedious - this can be checked by going into Number 7. on this page - <a href="http://www.sqlzoo.net/wiki/SELECT_within_SELECT_Tutorial" rel="noreferrer">http://www.sqlzoo.net/wiki/SELECT_within_SELECT_Tutorial</a></p>
  
  <p>I am trying to understand what I am writing wrong. I did the other questions okay, but this one seems to be a bit tricky (or possibly, more nested SELECT queries than I thought).</p>
  
  <p>Any suggestion/explanation is appreciated.</p>