SELECT basics/ja
Revision as of 20:46, 5 April 2018 by Kobashi.kaz (talk | contribs) (→Introducing the world table of countries: translate into Japanese)
Language: | [[:{{#invoke:String|sub|SELECT basics/ja
|1 |Expression error: Unrecognized punctuation character "{".}}|English]] |
---|
name | continent | area | population | gdp |
---|---|---|---|---|
Afghanistan | Asia | 652230 | 25500100 | 20343000000 |
Albania | Europe | 28748 | 2831741 | 12960000000 |
Algeria | Africa | 2381741 | 37100000 | 188681000000 |
Andorra | Europe | 468 | 78115 | 3712000000 |
Angola | Africa | 1246700 | 20609294 | 100990000000 |
.... |
world
テーブルの国々の導入
WHERE 節の使用例としてフランス France の人口 population を表示している。
注)文字列(短いテキストデータ)はこの様に'シングルクオート'で囲む。
ドイツ(Germany)の人口(population)を表示するように修正
SELECT population FROM world
WHERE name = 'France'
SELECT population FROM world
WHERE name = 'Germany'
Checking a list The word IN allows us to check if an item is in a list. The example shows the name and population for the countries 'Brazil', 'Russia', 'India' and 'China'.
Show the name and the population for 'Sweden', 'Norway' and 'Denmark'.
SELECT name, population FROM world
WHERE name IN ('Brazil', 'Russia', 'India', 'China');
SELECT name, population FROM world
WHERE name IN ('Sweden','Norway', 'Denmark');
Just the right size
Which countries are not too small and not too big?
BETWEEN
allows range checking (range specified is inclusive of boundary values). The example below shows countries with an area of 250,000-300,000 sq. km. Modify it to show the country and the area for countries with an area between 200,000 and 250,000.
SELECT name, area FROM world
WHERE area BETWEEN 250000 AND 300000
SELECT name, area FROM world
WHERE area BETWEEN 200000 AND 250000
- You are ready for tutorial one:SELECT statements with WHERE.
Language: | [[:{{#invoke:String|sub|SELECT basics/ja
|1 |Expression error: Unrecognized punctuation character "{".}}|English]] |
---|