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

  CREATE TABLE "E22B336U"."PRESCRIPTION" 
   (	"PRESCRIPTION_ID" NUMBER(20,0), 
	"MEDICAMENT" VARCHAR2(20 BYTE), 
	"MEDECIN" NUMBER(10,0), 
	"PATIENT" NUMBER(10,0), 
	"DATE_VISITE" VARCHAR2(20 BYTE), 
	"DUREE" VARCHAR2(20 BYTE), 
	"POSOLOGIE" VARCHAR2(20 BYTE), 
	"MODALITES" VARCHAR2(20 BYTE)
   ) 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.PRESCRIPTION
SET DEFINE OFF;
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('1','amoxicillin','1','1','10/11/2022','15','2 fois','oral');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('2','amoxicillin','1','2','15/11/2022','7','3 fois','usage externe');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('3',null,'1','5','10/11/2022','2','1 fois','oral');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('4',null,'2','3','12/11/2022','100','1 fois','usage externe');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('5','amoxicillin','2','4','20/11/2022','5','2 fois','oral');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('6',null,'3','6','18/11/2022','40','8 fois','oral');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('7',null,'4','7','21/11/2022','55','4 fois','usage externe');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('8',null,'5','8','10/11/2022','30','5 fois','usage externe');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('9','amoxicillin','6','9','14/11/2022','2','2 fois','oral');
Insert into E22B336U.PRESCRIPTION (PRESCRIPTION_ID,MEDICAMENT,MEDECIN,PATIENT,DATE_VISITE,DUREE,POSOLOGIE,MODALITES) values ('10',null,'7','10','15/11/2022','20','3 fois','oral');
--------------------------------------------------------
--  DDL for Index PRESCRIPTION_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "E22B336U"."PRESCRIPTION_PK" ON "E22B336U"."PRESCRIPTION" ("PRESCRIPTION_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 PRESCRIPTION
--------------------------------------------------------

  ALTER TABLE "E22B336U"."PRESCRIPTION" MODIFY ("PRESCRIPTION_ID" NOT NULL ENABLE);
  ALTER TABLE "E22B336U"."PRESCRIPTION" ADD CONSTRAINT "PRESCRIPTION_PK" PRIMARY KEY ("PRESCRIPTION_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 PRESCRIPTION
--------------------------------------------------------

  ALTER TABLE "E22B336U"."PRESCRIPTION" ADD CONSTRAINT "PRESCRIPTION_FK1" FOREIGN KEY ("MEDECIN", "PATIENT", "DATE_VISITE")
	  REFERENCES "E22B336U"."VISITE" ("MEDECIN", "PATIENT", "DATE_VISITE") ENABLE;
