Your entities and n2n relationship are ok, but the p_d_id key is not needed, if that 3 are the only fields of patient_disease
, then (patient_id, disease_id) is enough as its primary key.
Having p_d_id as primary key would let you have many rows with the same patient_id and disease_id, and what would that mean? for stating that a patient had a disease, it's enough with one just one row.
If, in change, you had another field, for example date, to signify the date in which a patient had a disease, then it would make sense to have an id of its own, because a patient could have the same disease twice, at different dates, but again, in that case, the date could be part of the primary id.
note: In relational theory, 'relation' and 'relationship' are different concepts, in your question, you wrote 'relation' but that's really a 'relationship'. A 'relation' is just a tuple, an instance of an entity, what in the DB would be a row.