Difference between revisions of "BBC QUIZ"
Line 83: | Line 83: | ||
{Select the code which shows just the population of United Kingdom? | {Select the code which shows just the population of United Kingdom? | ||
|type="()"} | |type="()"} | ||
− | - <syntaxhighlight lang='sql'> SELECT | + | - <syntaxhighlight lang='sql'> SELECT population FROM 'United Kingdom' </syntaxhighlight> |
- <syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE population = 'United Kingdom' </syntaxhighlight> | - <syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE population = 'United Kingdom' </syntaxhighlight> | ||
− | - <syntaxhighlight lang='sql'> SELECT | + | - <syntaxhighlight lang='sql'> SELECT FROM bbc WHERE population IN 'United Kingdom' </syntaxhighlight> |
+ <syntaxhighlight lang='sql'> SELECT population FROM bbc WHERE name = 'United Kingdom' </syntaxhighlight> | + <syntaxhighlight lang='sql'> SELECT population FROM bbc WHERE name = 'United Kingdom' </syntaxhighlight> | ||
− | - <syntaxhighlight lang='sql'> SELECT population FROM bbc WHERE | + | - <syntaxhighlight lang='sql'> SELECT population FROM bbc WHERE 'United Kingdom' IN name </syntaxhighlight> |
− | {Select the answer which shows the problem with this SQL code: | + | {Select the answer which shows the problem with this SQL code - the indended result should be the single row containing 'Europe': |
<syntaxhighlight lang='sql'> | <syntaxhighlight lang='sql'> | ||
− | SELECT | + | SELECT region |
− | FROM | + | FROM bbc |
− | WHERE | + | WHERE 'name' = 'France' |
</syntaxhighlight> | </syntaxhighlight> | ||
|type="()"} | |type="()"} | ||
− | - | + | - region should be 'region' |
− | + | + 'name' should be name | |
− | - | + | - 'France' should be "France" |
− | + | - 'France' should be France | |
− | - | + | - = should be IN |
{Select the result that would be obtained from the following code: | {Select the result that would be obtained from the following code: |
Revision as of 22:16, 5 July 2014
BBC 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 | |
Brazil | South America | 8550000 | 182800000 | 564852000000 |
Colombia | South America | 1140000 | 45600000 | |
Nauru | Asia-Pacific | 21 | 9900 | |
Uzbekistan | Central Asia | 447000 | 26000000 | |
... |
<quiz shuffle=none display=simple> {Select the code which gives the name of countries beginning with U |type="()"}
- SELECT name FROM bbc WHERE name BEGIN with U
SELECT name FROM bbc WHERE name LIKE '%U'
SELECT name FROM bbc WHERE name LIKE '%u%'
SELECT name FROM bbc WHERE name LIKE U
SELECT name FROM bbc WHERE name LIKE 'U%'
{Select the code which shows just the population of United Kingdom? |type="()"}
- SELECT population FROM 'United Kingdom'
SELECT name FROM bbc WHERE population = 'United Kingdom'
SELECT FROM bbc WHERE population IN 'United Kingdom'
SELECT population FROM bbc WHERE name = 'United Kingdom'
SELECT population FROM bbc WHERE 'United Kingdom' IN name
{Select the answer which shows the problem with this SQL code - the indended result should be the single row containing 'Europe':
SELECT region
FROM bbc
WHERE 'name' = 'France'
|type="()"} - region should be 'region' + 'name' should be name - 'France' should be "France" - 'France' should be France - = should be IN
{Select the result that would be obtained from the following code:
SELECT name, population / 10
FROM bbc
WHERE population < 10000
Andorra | 6400 |
Nauru | 990 |
Andorra | 64000 |
Nauru | 9900 |
Nauru | 99 |
Nauru | 990 |
Nauru | 9900 |
|type="()"} - Table-A - Table-B - Table-C + Table-D - Table-E
{Select the code which would reveal the name and population of countries in Europe, North America and South America |type="()"}
- SELECT name FROM bbc WHERE region IN ('Europe', 'North America', 'South America')
SELECT name, population FROM bbc WHERE region IN ('Europe', 'North America', 'South America')
SELECT name, population FROM bbc WHERE region IN (Europe North America South America)
SELECT name, population FROM bbc WHERE region IS ('Europe', 'North America', 'South America')
SELECT population FROM bbc WHERE region IN ('Europe', 'North America', 'South America')
{Select the code which would give two rows |type="()"}
- SELECT name FROM bbc WHERE name = 'United Kingdom'
SELECT name FROM bbc WHERE name = 'United Kingdom' AND name = 'Algeria'
SELECT name FROM bbc WHERE name EITHER ('United Kingdom', 'Algeria')
SELECT name FROM bbc WHERE name IN ('United Kingdom', 'Algeria')
SELECT name FROM WHERE name IS 'Scotland'
{Select the result that would be obtained from this code:
SELECT name FROM bbc WHERE region = 'South America' AND population > 40000000
Afghanistan |
Brazil |
Colombia |
Brazil |
Brazil |
Colombia |
Brazil | South America |
Colombia | South America |
Brazil | 182800000 |
Colombia | 45600000 |
|type="()"} - Table-A - Table-B + Table-C - Table-D - Table-E </quiz>