BBC QUIZ/zh
Language: | [[:{{#invoke:String|sub|BBC QUIZ/zh
|1 |Expression error: Unrecognised punctuation character "{".}}|English]] |
---|
name | continent | 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 | |
... |
選擇代碼找出以U開頭的國家名稱。
SELECT name
FROM world
WHERE name
BEGIN with U
SELECT name
FROM world
WHERE name LIKE '%U'
SELECT name
FROM world
WHERE name LIKE '%u%'
SELECT name
FROM world
WHERE name LIKE U
SELECT name
FROM world
WHERE name LIKE 'U%'
選擇代碼以顯示英國United Kingdom的人口。
SELECT population
FROM 'United Kingdom'
SELECT name
FROM world
WHERE population = 'United Kingdom'
SELECT FROM world
WHERE population IN 'United Kingdom'
SELECT population
FROM world
WHERE name = 'United Kingdom'
SELECT population
FROM world
WHERE 'United Kingdom' IN name
這個SQL代碼有什麼錯處。預計結果應該是含'France'的單列。
SELECT continent
FROM world
WHERE 'name' = 'France'
continent 應該是 'continent'
'name' 應該是 name
'France' 應該是 "France"
'France' 應該是 France
= 應該是 IN
選擇你會從這個代碼獲得的結果。
SELECT name, population / 10
FROM world
WHERE population < 10000
Andorra | 6400 |
Nauru | 990 |
Andorra | 64000 |
Nauru | 9900 |
Nauru | 99 |
Nauru | 990 |
Nauru | 9900 |
選擇代碼以顯示在歐洲和亞洲的國家的名稱和人口。
SELECT name
FROM world
WHERE continent IN ('Europe', 'Asia')
SELECT name, population
FROM world
WHERE continent IN ('Europe', 'Asia')
SELECT name, population
FROM world
WHERE name IN (Europe Asia)
SELECT name, population
FROM world
WHERE name IS ('Europe', 'Asia')
SELECT name, population
FROM world
WHERE continent = ('Europe', 'Asia')
選擇代碼,結果只有兩行。
SELECT name FROM world
WHERE name = 'Cuba'
SELECT name FROM world
WHERE name = 'Cuba'
AND name = 'Togo'
SELECT name FROM world
WHERE name EITHER ('Cuba', 'Togo')
SELECT name FROM world
WHERE name IN ('Cuba', 'Togo')
SELECT name FROM WHERE name IS 'Mali'
選擇你會從這個代碼獲得的結果。
SELECT name FROM world
WHERE continent = 'South America'
AND population > 40000000
Afghanistan |
Brazil |
Colombia |
Brazil |
Brazil |
Colombia |
Brazil | South America |
Colombia | South America |
Brazil | 182800000 |
Colombia | 45600000 |