Difference between revisions of "BBC QUIZ"

From SQLZOO
Jump to: navigation, search
Line 1: Line 1:
 
BBC QUIZ
 
BBC QUIZ
 
<quiz shuffle=none display=simple>
 
<quiz shuffle=none display=simple>
{Which of these gives the name of countries beginning with C?
+
{Select the code which gives the name of countries beginning with C
 
|type="()"}
 
|type="()"}
 
- SELECT name FROM bbc WHERE name BEGIN with C
 
- SELECT name FROM bbc WHERE name BEGIN with C
Line 9: Line 9:
 
+ SELECT name FROM bbc WHERE name LIKE 'C%'
 
+ SELECT name FROM bbc WHERE name LIKE 'C%'
  
{Which of these shows just the population of United Kingdom?
+
{Select the code which shows just the population of United Kingdom?
 
|type="()"}
 
|type="()"}
 
- SELECT name FROM bbc WHERE name Like 'United%'
 
- SELECT name FROM bbc WHERE name Like 'United%'
Line 18: Line 18:
  
  
{What is the problem with this SQL code:SELECT name FROM "bbc" WHERE population > '2000000'?
+
{Select the answer which shows the problem with this SQL code:SELECT name FROM "bbc" WHERE population > '2000000'
 
|type="()"}
 
|type="()"}
 
- Apostrophes should be used around 'bbc' instead of speech marks
 
- Apostrophes should be used around 'bbc' instead of speech marks
Line 24: Line 24:
 
+ There are speech marks surrounding "bbc"
 
+ There are speech marks surrounding "bbc"
 
- There are speech marks surrounding "bbc" and there is apostrophes surrounding '2000000'
 
- There are speech marks surrounding "bbc" and there is apostrophes surrounding '2000000'
- None of the above
+
- The use of a WHERE function is incorrect
  
{How would you reveal the name and population of countries in Europe, North America and South America?
+
{Select the code which would reveal the name and population of countries in Europe, North America and South America
 
|type="()"}
 
|type="()"}
 
- SELECT name FROM bbc WHERE region IN ('Europe', 'North America', 'South America')
 
- SELECT name FROM bbc WHERE region IN ('Europe', 'North America', 'South America')
Line 34: Line 34:
 
- SELECT population FROM bbc WHERE region IN ('Europe', 'North America', 'South America')
 
- SELECT population FROM bbc WHERE region IN ('Europe', 'North America', 'South America')
  
{Which of these coding wouldn't work?
+
{Select the code which would give two rows
 
|type="()"}
 
|type="()"}
- SELECT name FROM bbc WHERE name = 'United Kingdom' AND name = 'Algeria'
+
- SELECT name FROM bbc WHERE name = 'United Kingdom'
- SELECT name FROM bbc WHERE name = 'United Kingdom' or name = 'Algeria'
+
+ SELECT name FROM bbc WHERE name = 'United Kingdom' or name = 'Algeria'
+ SELECT name FROM bbc WHERE name EITHER ('United Kingdom', 'Algeria')
+
- SELECT name FROM bbc WHERE name EITHER ('United Kingdom', 'Algeria')
 
- SELECT name FROM bbc WHERE name IN ('United Kingdom', 'Algeria')
 
- SELECT name FROM bbc WHERE name IN ('United Kingdom', 'Algeria')
- None of the above
+
- SELECT name FROM WHERE name IS 'Scotland'
 
</quiz>
 
</quiz>
  
 
[[Category:Quizzes]]
 
[[Category:Quizzes]]

Revision as of 09:17, 23 July 2012

BBC QUIZ

1. Select the code which gives the name of countries beginning with C

SELECT name FROM bbc WHERE name BEGIN with C
SELECT name FROM bbc WHERE name LIKE '%C'
SELECT name FROM bbc WHERE name LIKE '%C%'
SELECT name FROM bbc WHERE name LIKE C
SELECT name FROM bbc WHERE name LIKE 'C%'

2. Select the code which shows just the population of United Kingdom?

SELECT name FROM bbc WHERE name Like 'United%'
SELECT name FROM bbc WHERE population = 'United Kingdom'
SELECT name, population FROM bbc WHERE name = 'United Kingdom'
SELECT population FROM bbc WHERE name = 'United Kingdom'
SELECT population FROM bbc WHERE name = United Kingdom

3. Select the answer which shows the problem with this SQL code:SELECT name FROM "bbc" WHERE population > '2000000'

Apostrophes should be used around 'bbc' instead of speech marks
There are apostrophes surrounding '2000000'
There are speech marks surrounding "bbc"
There are speech marks surrounding "bbc" and there is apostrophes surrounding '2000000'
The use of a WHERE function is incorrect

4. Select the code which would reveal the name and population of countries in Europe, North America and South America

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')

5. Select the code which would give two rows

SELECT name FROM bbc WHERE name = 'United Kingdom'
SELECT name FROM bbc WHERE name = 'United Kingdom' or 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'

Your score is 0 / 0
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense