『スッキリわかるSQL入門 第2版』のドリルを解き、ひたすら答えを載せていくシリーズです。今回は題材A・LEVEL2。難易度的にはまだまだ平気です。かかってこーーーーい!
9.
select *
from 口座
where 口座番号 = '0037651'
10.
select *
from 口座
where 残高 > 0
11.
select *
from 口座
where 口座番号 < '1000000'
12.
select *
from 口座
where 更新日 <= '2017-12-31'
13.
select *
from 口座
where 残高 >= 1000000
14.
select *
from 口座
where 種別 <> '1'
15.
select *
from 口座
where 更新日 is null
16.
select *
from 口座
where 名義 like '%ハシ%'
17.
select *
from 口座
where 更新日 between '2018-01-01' and '2018-01-31'
18.
select *
from 口座
where 種別 in ('2','3')
19.
select *
from 口座
where 名義 in ('サカタ リョウヘイ', 'マツモト ミワコ', 'ハマダ サトシ')
20.
select *
from 口座
where 更新日 >= '2017-12-30'
and 更新日 <= '2018-01-04'
21.
select *
from 口座
where 残高 < 10000
and 更新日 is not null
22.
select *
from 口座
where 口座番号 like '2______'
or 名義 like 'エ__ %コ'
23.
口座テーブル:口座番号
取引テーブル:取引番号
取引事由テーブル:取引事由ID