4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SQLのJOINについてメモ

4
Last updated at Posted at 2020-04-28

はじめに

SQL書いたことないのですが
時間があったので、学習する機会をいただきました。
結合についてつまづいたので、足早にメモです。

わからなかったこと

複数結合するとき、JOINする順番が(大切だということが)わからなかった。

簡単にイメージ

iOS の画像.jpg

うさぎ、ねこ、ひよこの3匹結合したい場合どうするか。
それぞれもっている旗に注目してください。

うさぎは◯、ひよこは×の旗を持っていますが、
ねこは、うさぎにもひよこにも持っている◯と×の旗を持っています。
そのため、うさぎとひよこの仲介としてねこを挟むことができます。
このようにすることで3匹が結合できるというイメージです。
(ここでは旗と言ってますが、実際SQLの場合は「カラム」や「値」)

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?