I created this table:
CREATE TABLE Hospital_MedicalRecord(
recNo CHAR(5),
patient CHAR(9),
doctor CHAR(9),
enteredOn DATETIME NOT NULL,
diagnosis LONGTEXT NOT NULL,
treatment TEXT(1000),
PRIMARY KEY (recNo, patient),
CONSTRAINT FK_patient FOREIGN KEY (patient) REFERENCES Hospital_Patient(NINumber),
CONSTRAINT FK_doctor FOREIGN KEY (doctor) REFERENCES Hospital_Doctor(NINumber)
ON DELETE CASCADE
);
How can one make diagnosis
contain some long text but never more than 2^24 bytes? I've looked into LONGTEXT
but I couldn't find a way to limit it since it can go up to 2^34 I believe?