ミームの死骸を待ちながら

We are built as gene machines and cultured as meme machines, but we have the power to turn against our creators. We, alone on earth, can rebel against the tyranny of the selfish replicators. - Richard Dawkins "Selfish Gene"

We are built as gene machines and cultured as meme machines, but we have the power to turn against our creators.
We, alone on earth, can rebel against the tyranny of the selfish replicators.
- Richard Dawkins "Selfish Gene"

基本のクエリ考え方

select の後に結果に出力する要素を「,」で区切って列挙。countやsumはどのtableにかかるのか注意*1
from で大元になるtable宣言し
join on で使うtableを結合、多くてもいい
where で検索の条件。primary keyのコネクト等
group by, order by も必要ならば
union all を使って、一緒には無理的なやつをくっつけて出力。

*1:tableを1文字の略語にしたり、select後の要素をas 'sth'で表示形式調整すると見やすくなる