1
CREATE TABLE if not exists PatientDetails
(pt_id varchar(15) not null,
pt_name varchar(20) not null,
pt_sname varchar(20) not null,
pt_age numeric,
primary key(pt_id));
create table if not exists who_staging.Symptom (
sypt_id varchar(12) not null,
symptom varchar(20) not null,
primary key(sypt_id)
);
create table if not exists Medicine(
medi_id varchar(12) not null,
medi_name varchar(20) not null,
sypt_id varchar(12),
foreign key(sypt_id) references who_staging.symptom(sypt_id),
primary key(medi_id)
);
create table if not exists who_staging.FollowUp(
F_id varchar(10) not null,
pt_id varchar(15),
sypt_id varchar(12),
medi_id varchar(12),
foreign key(pt_id) references who_staging.PatientDetails(pt_id),
foreign key(sypt_id) references who_staging.symptom(sypt_id),
foreign key(medi_id) references who_staging.Medicine(medi_id),
primary key(F_id)
);
该参考文献是否正确适用于以下内容?关系中的四个表格,患者详细信息,症状,医学和跟进
- 一名患者可以有多种症状。
- 对于一种症状,可以给予多种药物。
- 对于多种症状,可以给予一种药物。
- 一名患者可以有多次随访。
- 当选择了特定的跟进号时,系统应显示患者的详细信息以及患者正在服用哪种药物,以了解他/她患有哪种症状。
我将不胜感激任何帮助
对于初学者pt_id并不那么热。为什么不拍摄auto_inc int id?无论如何,谁是分配该患者ID的,并且您不必梦想一个auto_inc – Drew