 ALTER TABLE PRESCRIPTIONS
 ADD CONSTRAINT prescriptions_fk_icustay_id
   FOREIGN KEY (icustay_id)
-  REFERENCES icustayevents(icustay_id);
+  REFERENCES icustays(icustay_id);
 
 ------------------
 --PROCEDURES_ICD--

ALTER TABLE TRANSFERS
ADD CONSTRAINT transfers_fk_icustay_id
  FOREIGN KEY (icustay_id)
  REFERENCES icustayevents(icustay_id);

ALTER TABLE CHARTEVENTS
ADD CONSTRAINT chartevents_fk_icustay_id
  FOREIGN KEY (icustay_id)
  REFERENCES icustays(icustay_id);

-------------
--CPTEVENTS--
