Difference between revisions of "BBC QUIZ"

From SQLZOO
Jump to: navigation, search
Line 73: Line 73:
 
<div class=quiz shuffle=none display=simple>
 
<div class=quiz shuffle=none display=simple>
 
<div ans=4>Select the code which gives the name of countries beginning with U
 
<div ans=4>Select the code which gives the name of countries beginning with U
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name BEGIN with U </syntaxhighlight>
+
<syntaxhighlight lang='sql'>
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name LIKE '%U' </syntaxhighlight>
+
SELECT name
 +
  FROM bbc
 +
WHERE name
 +
BEGIN with U</syntaxhighlight>
 +
<syntaxhighlight lang='sql'>
 +
SELECT name
 +
  FROM bbc
 +
WHERE name LIKE '%U' </syntaxhighlight>
 
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name LIKE '%u%' </syntaxhighlight>
 
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name LIKE '%u%' </syntaxhighlight>
 
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name LIKE U </syntaxhighlight>
 
<syntaxhighlight lang='sql'> SELECT name FROM bbc WHERE name LIKE U </syntaxhighlight>

Revision as of 20:42, 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