Difference between revisions of "BBC QUIZ"

From SQLZOO
Jump to: navigation, search
Line 72: Line 72:
  
 
<div class=quiz shuffle=none display=simple>
 
<div class=quiz shuffle=none display=simple>
<div class='q'>Select the code which gives the name of countries beginning with U
+
<div class=q>Select the code which gives the name of countries beginning with U
 
<syntaxhighlight class=d lang='sql'>
 
<syntaxhighlight class=d lang='sql'>
 
SELECT name
 
SELECT name
Line 82: Line 82:
 
   FROM bbc
 
   FROM bbc
 
  WHERE name LIKE '%U' </syntaxhighlight>
 
  WHERE name LIKE '%U' </syntaxhighlight>
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name LIKE '%u%' </syntaxhighlight>
+
<syntaxhighlight class=d lang='sql'>
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name LIKE U </syntaxhighlight>
+
SELECT name
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name LIKE 'U%' </syntaxhighlight>
+
  FROM bbc
 +
WHERE name LIKE '%u%' </syntaxhighlight>
 +
<syntaxhighlight class=d lang='sql'>
 +
SELECT name
 +
  FROM bbc
 +
WHERE name LIKE U </syntaxhighlight>
 +
<syntaxhighlight class=d lang='sql'>
 +
SELECT name
 +
  FROM bbc
 +
WHERE name LIKE 'U%' </syntaxhighlight>
 
</div>
 
</div>
  
<div ans=3>Select the code which shows just the population of United Kingdom?
+
<div class=q>Select the code which shows just the population of United Kingdom?
<syntaxhighlight lang='sql'> SELECT population FROM 'United Kingdom' </syntaxhighlight>
+
<syntaxhighlight class=d lang='sql'> SELECT population FROM 'United Kingdom' </syntaxhighlight>
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE population = 'United Kingdom' </syntaxhighlight>
+
<syntaxhighlight class=d lang='sql'> SELECT name FROM bbc WHERE population = 'United Kingdom' </syntaxhighlight>
<syntaxhighlight lang='sql'> SELECT FROM bbc WHERE population IN 'United Kingdom' </syntaxhighlight>
+
<syntaxhighlight class=d lang='sql'> SELECT FROM bbc WHERE population IN 'United Kingdom' </syntaxhighlight>
<syntaxhighlight lang='sql'> SELECT population FROM bbc WHERE name = 'United Kingdom' </syntaxhighlight>
+
<syntaxhighlight class=d lang='sql'> SELECT population FROM bbc WHERE name = 'United Kingdom' </syntaxhighlight>
<syntaxhighlight lang='sql'> SELECT population FROM bbc WHERE 'United Kingdom' IN name </syntaxhighlight>
+
<syntaxhighlight class=d lang='sql'> SELECT population FROM bbc WHERE 'United Kingdom' IN name </syntaxhighlight>
 
</div>
 
</div>
 
</div>
 
</div>
 
[[Category:Quizzes]]
 
[[Category:Quizzes]]

Revision as of 21:00, 19 April 2015

bbc
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
...
Select the code which gives the name of countries beginning with U
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?
 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