--------------------------------------------------------
--  Fichier cr�� - ???-???-09-2022   
--------------------------------------------------------
--------------------------------------------------------
--  DDL for Table PATIENT
--------------------------------------------------------

  CREATE TABLE "E22B336U"."PATIENT" 
   (	"PATIENT_ID" NUMBER(10,0), 
	"NOM" VARCHAR2(20 BYTE), 
	"PRENOM" VARCHAR2(20 BYTE), 
	"NUMSECU" NUMBER(10,0), 
	"RATTACHEMENT" NUMBER(10,0), 
	"MEDECIN_REFERENT" NUMBER(10,0)
   ) 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 "USERS" ;
REM INSERTING into E22B336U.PATIENT
SET DEFINE OFF;
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('1','tom','pen','123','1','1');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('2','jim','li','324','2','1');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('3','lili','wang','213','3','2');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('4','jay','xi','456','4','2');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('5','mary','wu','356','5','1');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('6','wd','w','764','6','3');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('7','is','xi','555','7','4');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('8','lzq','s','443','8','5');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('9','wd','wds','246','9','6');
Insert into E22B336U.PATIENT (PATIENT_ID,NOM,PRENOM,NUMSECU,RATTACHEMENT,MEDECIN_REFERENT) values ('10','shen','wei','753','10','7');
--------------------------------------------------------
--  DDL for Index SYS_C0013274
--------------------------------------------------------

  CREATE UNIQUE INDEX "E22B336U"."SYS_C0013274" ON "E22B336U"."PATIENT" ("PATIENT_ID") 
  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 "USERS" ;
--------------------------------------------------------
--  Constraints for Table PATIENT
--------------------------------------------------------

  ALTER TABLE "E22B336U"."PATIENT" ADD PRIMARY KEY ("PATIENT_ID")
  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 "USERS"  ENABLE;
--------------------------------------------------------
--  Ref Constraints for Table PATIENT
--------------------------------------------------------

  ALTER TABLE "E22B336U"."PATIENT" ADD CONSTRAINT "MEDPAT" FOREIGN KEY ("MEDECIN_REFERENT")
	  REFERENCES "E22B336U"."MEDECIN" ("MEDECIN_ID") ENABLE;
  ALTER TABLE "E22B336U"."PATIENT" ADD CONSTRAINT "PATIENT_FK1" FOREIGN KEY ("RATTACHEMENT")
	  REFERENCES "E22B336U"."PATIENT" ("PATIENT_ID") ENABLE;
