DB
ER図

ER図の作り方【簡易版】

More than 1 year has passed since last update.

ER図とは

Untitled (5).png

DB設計の際に作成するもの。
Entity(実体)とRelationship(関係)を把握することができる。

作り方

① エンティティを作る

Untitled(2).png

  • 四角の上にテーブル名
  • 主キーは青枠内
  • その他のキーは白枠内
  • FKにはキーの後ろに (FK) と記述

② リレーションをはる

矢印の意味はこちらを参照。

③ 依存関係を調べる

Untitled (4).png

親子関係

分類 定義
親エンティティ 「1」側のエンティティ
子エンティティ 「多」側のエンティティ

依存がある とは

子エンティティの主キーが、親エンティティの全ての主キーを含んでいる関係。
この場合、 子エンティティを角丸にする。

参考

若手プログラマー必読!5分で理解できるER図の書き方5ステップ
五分では理解できなかった。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away