Difference between revisions of "Nested SELECT Quiz"
From SQLZOO
| Line 83: | Line 83: | ||
{Select the result that would be obtained from the following code: SELECT name FROM bbc WHERE population (SELECT population FROM bbc WHERE name='United Kingdom') AND region IN (SELECT region FROM bbc WHERE region = 'Europe') | {Select the result that would be obtained from the following code: SELECT name FROM bbc WHERE population (SELECT population FROM bbc WHERE name='United Kingdom') AND region IN (SELECT region FROM bbc WHERE region = 'Europe') | ||
| + | <table><caption>Table-A</caption><tr><td>Andorra</td></tr><tr><td>Albania</td></tr><tr><td>Austria</td></tr><tr><td>Bulgaria</td></tr></table> | ||
| + | <table><caption>Table-B</caption><tr><td>France</td><td>Europe</td></tr><tr><td>Germany</td><td>Europe</td></tr><tr><td>Russia</td><td>Europe</td></tr><tr><td>Turkey</td><td>Europe</td></tr></table> | ||
| + | <table><caption>Table-C</caption><tr><td>France</td></tr><tr><td>Germany</td></tr><tr><td>Andorra</td></tr><tr><td>Albania</td></tr></table> | ||
| + | <table><caption>Table-D</caption><tr><td>France</td></tr><tr><td>Germany</td></tr><tr><td>Russia</td></tr><tr><td>Turkey</td></tr></table> | ||
| + | <table><caption>Table-E</caption><tr><td>France</td></tr><tr><td>Germany</td></tr><tr><td>Russia</td></tr><tr><td>Turkey</td></tr><tr><td>Brazil</td></tr><tr><td>United States of USA</td></tr><tr><td>Canada</td></tr></table> | ||
|type="()"} | |type="()"} | ||
| − | - | + | - Table-A |
| − | - | + | - Table-B |
| − | - | + | - Table-C |
| − | + | + | + Table-D |
| − | - | + | - Table-E |
{Select the code that would show the countries with a greater GDP then any country in Africa | {Select the code that would show the countries with a greater GDP then any country in Africa | ||
| Line 107: | Line 112: | ||
{Select the result that would be obtained from the following code: SELECT name FROM bbc WHERE population > ALL (SELECT MAX(population) FROM bbc WHERE region = 'Europe') AND region ='South Asia' | {Select the result that would be obtained from the following code: SELECT name FROM bbc WHERE population > ALL (SELECT MAX(population) FROM bbc WHERE region = 'Europe') AND region ='South Asia' | ||
| + | <table><caption>Table-A</caption><tr><td>Afghanistan</td></tr><tr><td>Bhutan</td></tr><tr><td>Nepal</td></tr><tr><td>Sri Lanka</td></tr><tr><td>The Maldives</td></tr></table> | ||
| + | <table><caption>Table-B</caption><tr><td>Bangladesh</td></tr><tr><td>India</td></tr><tr><td>Pakistan</td></tr></table> | ||
| + | <table><caption>Table-C</caption><tr><td>China</td></tr><tr><td>India</td></tr></table> | ||
| + | <table><caption>Table-D</caption><tr><td>Brazil</td></tr><tr><td>Bangladesh</td></tr><tr><td>China</td></tr><tr><td>India</td></tr></table> | ||
| + | <table><caption>Table-E</caption><tr><td>France</td></tr><tr><td>Germany</td></tr><tr><td>Russia</td></tr><tr><td>Trukey</td></tr></table> | ||
|type="()"} | |type="()"} | ||
| − | - | + | - Table-A |
| − | + | + | + Table-B |
| − | - | + | - Table-C |
| − | - | + | - Table-D |
| − | - | + | - Table-E |
</quiz> | </quiz> | ||
[[Category:Quizzes]] | [[Category:Quizzes]] | ||
Revision as of 10:08, 7 August 2012
Nested SELECT quiz
| name | region | area | population | gdp |
|---|---|---|---|---|
| Afghanistan | South Asia | 652225 | 26000000 | |
| Albania | Europe | 28728 | 3200000 | 6656000000 |
| Algeria | Middle East | 2400000 | 32900000 | 75012000000 |
| Andorra | Europe | 468 | 64000 | |
| Bangladesh | South Asia | 143998 | 152600000 | 67144000000 |
| United Kingdom | Europe | 242514 | 59600000 | 2022824000000 |
| ... | ||||