vaccineprerequisite
Table Name: vaccineprerequisite
The vaccineprerequisite table defines relationships between vaccines, indicating prerequisites that must be fulfilled before administering a specific vaccine.
Columns
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| vaccineId | smallint(6) | Primary Key, Not Null, Foreign Key | The ID of the vaccine requiring prerequisites. |
| vaccinePrerequisiteId | smallint(6) | Primary Key, Not Null, Foreign Key | The ID of the prerequisite vaccine that must be administered first. |
| mandatory | tinyint(1) | Nullable | Indicates if the prerequisite is mandatory (1) or optional (0). |
Indexes
- Primary Key:
- vaccineId, vaccinePrerequisiteId: Ensures uniqueness for each vaccine-prerequisite pair.
- Foreign Keys:
- FKED048EEB160DDAC0:
- References vaccine(vaccineId) for the vaccineId column.
- vaccprereq_prereqId_vaccine_vaccineId_FK:
- References vaccine(vaccineId) for the vaccinePrerequisiteId column.
- FKED048EEB160DDAC0:
- Additional Index:
- Index on vaccinePrerequisiteId to improve query performance for prerequisite lookups.
Foreign Key Relations
- FKED048EEB160DDAC0:
- Referenced Table: vaccine
- Referenced Column: vaccineId
- Description: Ensures that the vaccineId in the vaccineprerequisite table corresponds to a valid vaccineId in the vaccine table. This establishes the relationship between the vaccine that requires a prerequisite and the prerequisite itself.
- vaccprereq_prereqId_vaccine_vaccineId_FK:
- Referenced Table: vaccine
- Referenced Column: vaccineId
- Description: Ensures that the vaccinePrerequisiteId in the vaccineprerequisite table refers to a valid vaccine that acts as a prerequisite. This maintains the integrity of the prerequisite-vaccine relationship.
Usage Notes
- Purpose:
- Establishes a dependency relationship between vaccines, ensuring the proper sequence of administration.
- Helps enforce business rules like "Vaccine B cannot be administered until Vaccine A has been given."
- Key Attributes:
- vaccineId: Represents the vaccine that has prerequisites.
- vaccinePrerequisiteId: Represents the prerequisite vaccine that must be completed first.
- mandatory: Determines whether the prerequisite is compulsory (1) or optional (0).