what is the use of "constraint.sql"? #1134
Replies: 1 comment
-
The constraint.sql script adds constraints to the Postgres database. Constraints are rules that must be complied with by the database. For example, the following constraint sets the Once this constraint is added, your database will raise a "duplicate key" error if you try to insert a value that already appears in the ALTER TABLE mimic_core.patients
ADD CONSTRAINT patients_pk
PRIMARY KEY (subject_id); It is not necessary to add these constraints. They can be helpful for maintaining database integrity (for example, adding the constraint above would prevent you from accidentally loading duplicate patient data into the Constraints may have performance implications, so you may decide that they are unnecessary. MIMIC is essentially a read-only dataset, so integrity is less of a worry than it might be for transactional datasets where there are frequent updates. |
Beta Was this translation helpful? Give feedback.
-
what is the use of "constraint.sql"?
Beta Was this translation helpful? Give feedback.
All reactions