gpt4 book ai didi

mysql - 如何将流程添加为数据库中的关系,例如捐赠记录等

转载 作者:行者123 更新时间:2023-11-29 16:34:40 27 4
gpt4 key购买 nike

enter image description here

I wanted to record processes of donating blood by a donor to a blood bank as well as processes of accepting blood by a patient from a blood bank by including table of the processes

record of Donation and record of Acceptance

I was confused on how to add the tables should i link them with the donors or the bank can i get help with plus any other additional info i will grateful.

最佳答案

我不确定我是否完全理解您发布的图片,但根据您的解释,这是适合您的用例的示例设计。

1) 从以下 3 个表开始:它们定义基础对象,并且彼此独立。

DONOR
ID -- primary key
NAME
BLOOD_GROUP
MEDICAL_REPORT
CONTACT_NUMBER
ADDRESS

PATIENT
ID -- primary key
NAME
BLOOD_GROUP
DISEASE

BLOOD_BANK
ID -- primary key
ADDRESS
CONTACT_NUMBER

现在您已准备好创建用于跟踪捐赠和接受的表格。

2) 捐赠表引用了捐赠者和血库:

DONATION
ID -- primary key
DONOR_ID -- foreign key to DONOR.ID
BLOOD_BANK_ID -- foreign key to BLOOD_BANK.ID
PLACE
TIME
AMOUNT

3) 接受表引用捐赠和患者:

 ACCEPTANCE
ID -- primary key
PATIENT_ID -- foreign key to PATIENT.ID
DONATION_ID -- foreign key to DONATION.ID

关于mysql - 如何将流程添加为数据库中的关系,例如捐赠记录等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53693628/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com