一、ER圖分析
該ER模型由4個實體組成,分别是快遞公司、消費者、管理員和快遞查詢。其中,管理員與快遞公司、消費者是N:N的關系,需要将聯系轉換為實體,然後在該實體上加上另外兩個實體的主鍵,作為聯系實體的主鍵。
然後再加上該聯系自身帶的屬性。而管理員和快遞查詢是1:N的關系,需要在快遞查詢端添加管理員的主鍵作為外碼。由此可知,快遞公司的主碼是公司名稱,沒有外碼;消費者的主碼是消費者身份碼,也沒有外碼;
管理員的主碼為管理員id,也沒有外碼;快遞查詢的主碼為快遞單号,外碼為管理員id;合作的主碼為(公司名稱、管理員id),外碼為公司名稱、管理員id;寄取的主碼為(管理員id、消費者身份碼),外碼為管理員id、消費者身份碼。
1. ER diagram analysis
The ER model consists of 4 entities, which are courier company, consumer, administrator and courier inquiry. Among them, the relationship between the administrator, the courier company and the consumer is N:N.
The relationship needs to be converted into an entity, and then the primary key of the other two entities is added to the entity as the primary key of the contact entity, and then the relationship is added. own properties.
The administrator and express query are in a 1:N relationship, and the administrator's primary key needs to be added as a foreign code on the express query end. It can be seen that the main code of the courier company has no external code;
the main code of the consumer is the consumer identity code, and there is no external code; the main code of the administrator is the administrator id, and there is no external code;
the express query The main code is the express order number, and the external code is the administrator id; the main code for cooperation is (company name, administrator id), and the external code is the company name and administrator id;
the main code sent is (administrator id, consumer id) User ID), the outer code is the administrator id, consumer ID.
二、ER圖的關系模型
快遞公司(公司名稱、到達時間、收費價格)
消費者(消費者身份碼、電話、地址信息、消費者姓名)
管理員(管理員id、姓名、登陸密碼、快遞用戶名)
快遞查詢(快遞單号、管理員id、收件人id、收件人電話、收件人姓名)
合作(公司名稱、管理員id)
寄取(管理員id、消費者身份碼)
Second, the relational model of ER diagram
Courier company (company name, arrival time, chargeable price)
Consumer (Consumer ID, Phone, Address Information, Consumer Name)
Administrator (admin id, name, login password, express username)
Express query (express order number, administrator id, recipient id, recipient phone number, recipient name)
Cooperation (company name, administrator id)
Send (admin id, consumer ID)
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!