IT and software
Order management table relationships (ER diagram, crow's foot notation)
An order management ER diagram with primary and foreign keys, and the one-to-many relationships drawn as crow feet
This drawing comes from one YAML file. No shape was moved by hand.
Notes in the source (in Japanese)
鳥の足(crow's foot)は、線の端の形が「何個つながるか」を言う。線そのものではなく、端を読む図。
| 端の形 | 意味 |
|---|---|
| 三またの足 | 多。この図では「1 以上」(受注 1 件に明細は 1 行以上、商品 1 つに価格は 1 行以上) |
| 縦棒 1 本 | ちょうど 1 |
| 丸 + 三またの足 | 0 以上(まだ 1 件も無くてよい) |
| 丸 + 縦棒 | 0 または 1 |
正式な IE 記法では「1 以上」は縦棒 + 三またの足、「ちょうど 1」は縦棒 2 本で描く。この道具の端の記号にはその 2 つが無いので、縦棒 1 本と三またの足だけで代えている。
「0 でもよい」かどうかは、業務のほうから決まる。まだ 1 件も注文していない顧客はいる(顧客 → 受注は 0 以上)。一度も売れていない商品もある(商品 → 明細も 0 以上)。受注 1 件に対する出荷は、まだ無いか 1 回(0 または 1)——端の形が、その表に何が入り得るかをそのまま言っている。
受注 1 件に明細は何行でも付く。同じ表に入れると、受注の日付が行の数だけ重複する。表を分ける理由は、たいていこの「個数の違い」にある。
商品は 1 つでも、価格は時期で変わる。過去の受注は、そのときの価格で残す。
鳥の足記法(IE 記法)の実体は矩形。円柱は「データベース(格納庫)」の記号なので、表 1 つずつを円柱にすると「DB が 8 個ある」と読まれる。在庫(商品×倉庫)の 2 本も、矢印ではなく端の形で言う(商品 1 に対して在庫行は 0 以上)。
Source (YAML)
examples/gallery/21-テーブルの関係.zumen.yaml
More in this field
An on-premise server layout rack by rack, with the redundant power feeds and network links drawn as separate paths
A cloud architecture showing the VPC and its subnets, and where the load balancer, application, database and object store sit
Where data goes from collection through transformation, storage and aggregation to display, and what kind of container holds it at each step
A network layout of the links and equipment between sites, with the address range carried by each segment
A server room where racks face each other to make hot and cold aisles, with the clearance of each aisle written in
A UML class diagram where inheritance, realisation, association and aggregation are told apart by line type and end symbol
A UML state machine with transitions, the events and guards that fire them, and the pseudostates that begin and end it
A UML use case diagram with the actors, the use cases, and the include and extend relationships between them