Chapter 3. DDL Script Page 83 CREATE TABLE mc_patients (id NUMBER(9) NOT NULL ,ptype VARCHAR2(10) NOT NULL CONSTRAINT mc_pat_cc1 CHECK (ptype IN ('INPATIENT' ,'OUTPATIENT')) ,surname VARCHAR2(30) NOT NULL ,forename VARCHAR2(30) NOT NULL ,date_of_birth DATE ,f_bal_bed NUMBER(9) ,CONSTRAINT mc_pat_pk PRIMARY KEY (id) ,CONSTRAINT mc_pat_bal_fk FOREIGN KEY REFERENCES mc_bed_allocations ,CONSTRAINT mc_pat_cc2 CHECK(ptype = 'INPATIENT' OR f_bal_bed IS NULL)); CREATE VIEW mc_outpatients_v AS SELECT pat.id ,pat.surname ,pat.forename ,date_of_birth FROM mc_patients pat WHERE pat.ptype = 'OUTPATIENT' WITH CHECK OPTION CONSTRAINT mc_opt_cc1; CREATE VIEW mc_inpatients_v ...