

  CREATE TABLE "STAFF" 
   (	"STAFFNO" CHAR(3) NOT NULL ENABLE, 
	"STAFFNAME" VARCHAR2(50), 
	 CONSTRAINT "PK_STAFF" PRIMARY KEY ("STAFFNO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "WARD" 
   (	"WARDNO" CHAR(3) NOT NULL ENABLE, 
	"MAXBEDS" NUMBER(22,0), 
	"WARDNAME" VARCHAR2(30), 
	 CONSTRAINT "PK_WARD" PRIMARY KEY ("WARDNO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "DOCTOR" 
   (	"STAFFNO" CHAR(3) NOT NULL ENABLE, 
	"DOCPOSITION" VARCHAR2(30), 
	"SPECIALTY" VARCHAR2(30), 
	 CONSTRAINT "PK_STAFFNO" PRIMARY KEY ("STAFFNO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE, 
	 CONSTRAINT "STAFF" FOREIGN KEY ("STAFFNO")
	  REFERENCES "STAFF" ("STAFFNO") ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "NURSE" 
   (	"STAFFNO" CHAR(3) NOT NULL ENABLE, 
	"WARD" CHAR(3), 
	 CONSTRAINT "PK_NURSE" PRIMARY KEY ("STAFFNO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE, 
	 CONSTRAINT "WARD" FOREIGN KEY ("WARD")
	  REFERENCES "WARD" ("WARDNO") ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "PATIENT" 
   (	"PATIENTID" CHAR(3) NOT NULL ENABLE, 
	"DOCTORNO" CHAR(3), 
	"WARDNO" CHAR(3), 
	"NAME" VARCHAR2(30), 
	 CONSTRAINT "PK_PATIENT" PRIMARY KEY ("PATIENTID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE, 
	 CONSTRAINT "DOCTOR" FOREIGN KEY ("DOCTORNO")
	  REFERENCES "DOCTOR" ("STAFFNO") ENABLE, 
	 CONSTRAINT "PATIENTWARD" FOREIGN KEY ("WARDNO")
	  REFERENCES "WARD" ("WARDNO") ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "RECEIPT" 
   (	"RCPTNO" NUMBER(*,0) NOT NULL ENABLE, 
	"RCPTDATE" DATE NOT NULL ENABLE, 
	"PATIENTID" CHAR(3) NOT NULL ENABLE, 
	 CONSTRAINT "RECEIPT_PK" PRIMARY KEY ("RCPTNO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE, 
	 CONSTRAINT "FK_RCPTPATIENT" FOREIGN KEY ("PATIENTID")
	  REFERENCES "PATIENT" ("PATIENTID") ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "SUPERVISES" 
   (	"RELID" NUMBER(22,0), 
	"ISSUPERVISOR" CHAR(1) NOT NULL ENABLE, 
	"NURSENO" CHAR(3) NOT NULL ENABLE, 
	 CONSTRAINT "SUPERVISES_PK" PRIMARY KEY ("RELID", "ISSUPERVISOR")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE, 
	 CONSTRAINT "FK_NURSE" FOREIGN KEY ("NURSENO")
	  REFERENCES "NURSE" ("STAFFNO") ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "BILL" 
   (	"BILLNO" CHAR(8), 
	"PATIENTID" CHAR(3) NOT NULL ENABLE, 
	"NURSEID" CHAR(3) NOT NULL ENABLE, 
	"BILLDATE" DATE DEFAULT sysdate, 
	 CONSTRAINT "BILL_PK" PRIMARY KEY ("BILLNO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE, 
	 CONSTRAINT "BILL_PATIENT_FK" FOREIGN KEY ("PATIENTID")
	  REFERENCES "PATIENT" ("PATIENTID") ENABLE, 
	 CONSTRAINT "BILL_NURSE_FK" FOREIGN KEY ("NURSEID")
	  REFERENCES "NURSE" ("STAFFNO") ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "BILLITEM" 
   (	"BILLNO" CHAR(8), 
	"ITEMNAME" VARCHAR2(20), 
	"QTY" NUMBER(3,0), 
	"UNITPRICE" NUMBER(7,2), 
	"LINENO" NUMBER, 
	 CONSTRAINT "BILLITEM_PK" PRIMARY KEY ("BILLNO", "ITEMNAME")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE, 
	 CONSTRAINT "BILL_QTY_CHECK" CHECK (qty>0) ENABLE, 
	 CONSTRAINT "BILLITEM_BILL_FK" FOREIGN KEY ("BILLNO")
	  REFERENCES "BILL" ("BILLNO") ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

  CREATE TABLE "RCPTDETAIL" 
   (	"RCPTNO" NUMBER(*,0) NOT NULL ENABLE, 
	"BILLNO" CHAR(8) NOT NULL ENABLE, 
	"LINENO" NUMBER(*,0) NOT NULL ENABLE, 
	 CONSTRAINT "RCPTDETAIL_PK" PRIMARY KEY ("BILLNO", "LINENO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT"  ENABLE, 
	 CONSTRAINT "FK_RECEIPT" FOREIGN KEY ("RCPTNO")
	  REFERENCES "RECEIPT" ("RCPTNO") ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STUDENT" ;

INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('110','Liversage');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('113','Hutt');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('126','Sesonske');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('131','Kalsi');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('153','Cooke');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('156','Hollis');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('174','Gibson');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('178','Paxton');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('192','Wilkie');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('200','Tamblin');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('206','Reay');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('218','Peters');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('222','Ullman');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('231','Ansell');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('232','Shine');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('256','Locke');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('268','Dowse');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('283','Sahdev');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('315','Aslam');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('345','Copleston');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('349','Connor');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('360','Sykes');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('362','Colman');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('373','Vine');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('385','Zorkoczy');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('389','Wright');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('424','Slee');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('458','Galvin');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('462','Webster');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('493','Rampton');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('517','Goss');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('523','Descartes');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('535','Aris');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('543','Maier');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('603','Nolan');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('606','Orchard');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('607','Hughes');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('614','Hill');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('617','Patel');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('680','Wolfe');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('700','Birch');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('723','Asif');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('736','Palmer');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('744','Winch');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('765','Fleming');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('784','Franklin');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('789','Warnock');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('823','Sadiq');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('838','Brown');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('840','Leverett');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('857','Neville');
INSERT INTO STAFF (STAFFNO,STAFFNAME) VALUES ('862','Franklin');


INSERT INTO WARD (WARDNO,MAXBEDS,WARDNAME) VALUES ('w2 ',20,'Wessex');
INSERT INTO WARD (WARDNO,MAXBEDS,WARDNAME) VALUES ('w3 ',15,'Anglia');
INSERT INTO WARD (WARDNO,MAXBEDS,WARDNAME) VALUES ('w4 ',20,'Lakes');
INSERT INTO WARD (WARDNO,MAXBEDS,WARDNAME) VALUES ('w5 ',15,'Dales');
INSERT INTO WARD (WARDNO,MAXBEDS,WARDNAME) VALUES ('w7 ',12,'Pennines');
INSERT INTO WARD (WARDNO,MAXBEDS,WARDNAME) VALUES ('w10',0,'Empty Ward');

INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('110','Consultant','Cardiac');
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('131','Consultant','Orthopaedic');
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('156','Registrar',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('174','Registrar',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('178','Registrar',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('200','Consultant','Paediatric');
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('231','Consultant','Orthopaedic');
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('232','Consultant','Geriatric');
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('268','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('385','Registrar',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('389','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('462','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('493','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('517','Registrar',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('603','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('606','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('614','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('680','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('723','Registrar',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('736','Registrar',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('784','Consultant','Gynaecology');
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('857','House Officer',NULL);
INSERT INTO DOCTOR (STAFFNO,DOCPOSITION,SPECIALTY) VALUES ('862','House Officer',NULL);


INSERT INTO NURSE (STAFFNO,WARD) VALUES ('113','w7 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('126','w4 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('153','w3 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('192','w2 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('206','w3 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('218','w4 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('222','w7 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('256','w4 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('283','w3 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('315','w5 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('345','w4 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('349','w4 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('360','w2 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('362','w2 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('373','w3 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('424','w2 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('458','w5 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('523','w4 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('535','w2 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('543','w7 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('607','w3 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('617','w2 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('700','w3 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('744','w5 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('765','w4 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('789','w4 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('823','w2 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('838','w5 ');
INSERT INTO NURSE (STAFFNO,WARD) VALUES ('840','w5 ');


INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p01','231','w5 ','Bell');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p02','110','w2 ','Robinson');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p03','110','w7 ','Edmonds');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p04','232','w3 ','Anarkali');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p05','110','w2 ','Pettit');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p06','231','w4 ','Smith');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p07','784','w5 ','Tennent');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p08','200','w4 ','James');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p09','131','w3 ','Kay');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p10','231','w4 ','Jones');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p11','110','w7 ','Benyon');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p12','232','w2 ','Hook');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p13','200','w4 ','Woodward');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p14','131','w3 ','Bird');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p15','231','w4 ','Harris');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p16','110','w7 ','Samuel');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p17','131','w3 ','Rosewood');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p18','110','w2 ','Toppaz');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p19','784','w5 ','Cumberland');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p20','231','w5 ','Roland');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p21','200','w4 ','Cornish');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p22','232','w2 ','Parsi');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p23','232','w3 ','Smith');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p24','110','w7 ','Docker');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p25','131','w3 ','Diamond');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p26','232','w2 ','Colbert');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p27','231','w5 ','Ozbekof');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p28','784','w5 ','Kraft');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p29','231','w4 ','Jones');
INSERT INTO PATIENT (PATIENTID,DOCTORNO,WARDNO,NAME) VALUES ('p30','110','w2 ','Parkinson');

INSERT INTO RECEIPT (RCPTNO,RCPTDATE,PATIENTID) VALUES (1,TIMESTAMP '2014-10-10 00:00:00.000000','p01');
INSERT INTO RECEIPT (RCPTNO,RCPTDATE,PATIENTID) VALUES (2,TIMESTAMP '2014-10-11 00:00:00.000000','p01');
INSERT INTO RECEIPT (RCPTNO,RCPTDATE,PATIENTID) VALUES (3,TIMESTAMP '2014-10-12 00:00:00.000000','p02');
INSERT INTO RECEIPT (RCPTNO,RCPTDATE,PATIENTID) VALUES (4,TIMESTAMP '2014-10-12 00:00:00.000000','p02');
INSERT INTO RECEIPT (RCPTNO,RCPTDATE,PATIENTID) VALUES (6,TIMESTAMP '2014-10-12 00:00:00.000000','p02');
INSERT INTO RECEIPT (RCPTNO,RCPTDATE,PATIENTID) VALUES (5,TIMESTAMP '2014-10-12 00:00:00.000000','p01');

INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (1,'N','153');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (2,'N','192');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (3,'N','206');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (4,'N','218');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (5,'N','222');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (6,'N','256');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (7,'N','283');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (8,'N','315');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (9,'N','345');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (10,'N','349');

INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (11,'N','360');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (12,'N','373');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (13,'N','424');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (14,'N','523');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (15,'N','535');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (16,'N','543');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (17,'N','607');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (18,'N','617');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (19,'N','744');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (20,'N','765');

INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (21,'N','789');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (22,'N','838');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (23,'N','840');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (24,'N','823');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (1,'Y','700');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (2,'Y','362');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (3,'Y','700');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (4,'Y','126');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (5,'Y','113');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (6,'Y','126');

INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (7,'Y','700');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (8,'Y','458');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (9,'Y','126');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (10,'Y','126');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (11,'Y','362');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (12,'Y','700');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (13,'Y','362');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (14,'Y','126');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (15,'Y','362');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (16,'Y','113');

INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (17,'Y','700');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (18,'Y','362');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (19,'Y','458');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (20,'Y','126');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (21,'Y','126');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (22,'Y','458');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (23,'Y','458');
INSERT INTO SUPERVISES (RELID,ISSUPERVISOR,NURSENO) VALUES (24,'Y','362');


INSERT INTO BILL (BILLNO,PATIENTID,NURSEID,BILLDATE) VALUES ('10000001','p07','458',TIMESTAMP '2019-10-26 06:57:23.000000');
INSERT INTO BILL (BILLNO,PATIENTID,NURSEID,BILLDATE) VALUES ('10000002','p01','458',TIMESTAMP '2019-10-26 07:03:53.000000');
INSERT INTO BILL (BILLNO,PATIENTID,NURSEID,BILLDATE) VALUES ('10000003','p02','458',TIMESTAMP '2019-10-26 07:03:53.000000');
INSERT INTO BILL (BILLNO,PATIENTID,NURSEID,BILLDATE) VALUES ('10000004','p01','458',TIMESTAMP '2019-10-26 07:03:54.000000');
INSERT INTO BILL (BILLNO,PATIENTID,NURSEID,BILLDATE) VALUES ('10000006','p01','458',TIMESTAMP '2019-10-26 07:03:54.000000');
INSERT INTO BILL (BILLNO,PATIENTID,NURSEID,BILLDATE) VALUES ('10000005','p03','543',TIMESTAMP '2019-10-26 07:03:54.000000');

INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000001','Room',1,1000.5,1);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000002','Room',5,5000,1);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000002','Expensive medicine',6,10000,2);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000002','Fluffy pillows',2,500,3);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000002','Ping machine',1,10000,4);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000003','Room',5,5000,1);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000003','Expensive medicine',6,10000,2);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000004','Room',5,5000,1);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000004','Expensive medicine',6,10000,2);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000006','Room',5,5000,1);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000006','Expensive medicine',6,10000,2);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000005','Room',5,5000,1);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000005','Expensive medicine',6,10000,2);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000005','Fluffy pillows',2,500,3);
INSERT INTO BILLITEM (BILLNO,ITEMNAME,QTY,UNITPRICE,LINENO) VALUES ('10000005','Ping machine',1,10000,4);

INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (1,'10000002',1);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (1,'10000002',2);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (2,'10000002',3);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (3,'10000003',1);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (3,'10000003',2);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (4,'10000004',1);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (4,'10000004',2);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (4,'10000002',4);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (6,'10000006',1);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (6,'10000006',2);
INSERT INTO RCPTDETAIL (RCPTNO,BILLNO,LINENO) VALUES (5,'10000005',1);