Difference between revisions of "SELECT basics/ja"
Jump to navigation
Jump to search
(Created page with "{{Languages}} <div class="ref_section"> <table class='db_ref'><caption>world</caption> <tr><th>name</th><th>continent</th><th>area</th> <th>population</th><th>gdp</th></tr> <t...") |
Kobashi.kaz (talk | contribs) (→Introducing the world table of countries: translate into Japanese) |
||
Line 16: | Line 16: | ||
<div class='extra_space' style='width:1em; height:6em;'></div> | <div class='extra_space' style='width:1em; height:6em;'></div> | ||
− | == | + | ==<code>world</code> テーブルの国々の導入== |
<div class='qu'> | <div class='qu'> | ||
− | + | WHERE 節の使用例としてフランス France の人口 population を表示している。 | |
− | |||
− | <p class='imper'> | + | 注)文字列(短いテキストデータ)はこの様に'シングルクオート'で囲む。 |
+ | |||
+ | <p class='imper'>ドイツ(Germany)の人口(population)を表示するように修正</p> | ||
<source lang='sql' class='def'> | <source lang='sql' class='def'> |
Revision as of 20:46, 5 April 2018
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]] |
---|