In the first half of 2021, the real questions and answer analysis of software designers in the afternoon (2)

[Description]
A community vegetable group buying website needs to develop an information system in order to standardize the delivery and delivery process of products and facilitate the query of customer orders. Please complete the database design of the system according to the following requirement description.
【Description of requirements】
(1) Record the information of vegetable suppliers, including supplier number, address and a phone number.
(2) Record the information of the community group buying point, including the group buying point number, address and a phone number.
(3) Record customer information, including customer name and a phone number. Customers can place orders at different community group buying points without directly contacting vegetable suppliers.
(4) Record customer order information, including order number, group buying point number, customer phone number, order content and date.
[Conceptual model design]
According to the information collected in the requirements stage, the designed entity relationship diagram (incomplete) is shown in Figure 2-1.
insert image description here
[Logical structure design]
According to the entity connection diagram completed in the conceptual model design stage, the following relationship model (incomplete) is obtained:
vegetable supplier (supplier number, address, telephone)
community group buying point (group buying point number, address, Telephone)
supply (supplier number, (a))
customer (name, customer phone number)
order (order number, group buying point number, order content, date, (b))

[Question 1] (6 points)
According to the problem description, supplement the entity connection diagram in Figure 2-1.
insert image description here

[Question 2] (4 points)
Supplement the two vacancies (a) and (b) in the logical structure design results and the integrity constraint relationship.

(a):团购点编号。主键为:(供货商编号,团购点编号),外键为:供货商编号,团购点编号。
(b):客户电话。 主键为:订单编号,外键为:团购点编号,客户电话。

[Question 3] (5 points)
If the community vegetable group buying website also has the business of receiving express delivery, please add a new "express" entity, and give the "receive" connection between the customer entity and the express entity. Compare Figure 2 -1 for replenishment. The "Courier" relational schema includes the courier number, customer phone, and date.
insert image description here
Answer analysis:
[Question 1]
According to the description of order information in the question stem, customer order information needs to be recorded, including order number, group buying point number, customer phone number, order content and date, including group buying point number, customer phone number, so The order table is related to the community group buying point relationship and customer relationship, and the degree of connection between group buying and customers is *:*.
[Question 2]
According to the entity connection diagram in Figure 1-1, it can be known that the relationship between suppliers and group buying is many-to-many, so the supply connection needs to be converted into a separate table, and the attributes take the codes of multiple parties and their own attributes.
[Question 3]
According to the description of the question stem, if the community vegetable group buying website also has the business of collecting express delivery, please add a new "express" entity, and give the "receive" connection between the customer entity and the express entity. The "Courier" relational schema includes the courier number, customer phone, and date. It is necessary to add the receiving contact and courier relationship, and the courier relationship includes the attributes courier number, customer phone number and date, where the courier number is the primary key.

Guess you like

Origin blog.csdn.net/johnWcheung/article/details/127697168