CREATE TABLE allergy
(
  allergyid int NOT NULL,
  name nvarchar(281)
);
CREATE TABLE allergy_cross
(
  allergyid1 int NOT NULL,
  allergyid2 int NOT NULL
);
CREATE TABLE allergy_molecule
(
  allergyid int NOT NULL,
  moleculeid int NOT NULL
);
CREATE TABLE atcclass
(
  atcclassid int NOT NULL,
  parentid int,
  name nvarchar(281) NOT NULL,
  code nvarchar(20)
);
CREATE TABLE ci_epp
(
  contraindicationid int NOT NULL,
  epp int NOT NULL,
  min_value int,
  max_value int
);
CREATE TABLE cim10
(
  cim10id int NOT NULL,
  parentid int,
  code nvarchar(20),
  name nvarchar(281)
);
CREATE TABLE cim10_contraindication
(
  contraindicationid int NOT NULL,
  cim10id int NOT NULL
);
CREATE TABLE cim10_indicationgroup
(
  indicationgroupid int NOT NULL,
  cim10id int NOT NULL
);
CREATE TABLE commonnamegroup
(
  commonnamegroupid int NOT NULL,
  name nvarchar(281),
  galenicformid int NOT NULL,
  name_noaccent nvarchar(281)
);
CREATE TABLE commonnamegroup_atc
(
  atcclassid int NOT NULL,
  commonnamegroupid int NOT NULL
);
CREATE TABLE commonnamegroup_composition
(
  commonnamegroupid int NOT NULL,
  moleculeid int NOT NULL,
  pervolume decimal(16,5),
  perVolumeUnit nvarchar(50),
  type smallint,
  unit_Id int
);
CREATE TABLE commonnamegroup_contra
(
  contraindicationid int NOT NULL,
  commonnamegroupid int NOT NULL,
  type smallint NOT NULL
);
CREATE TABLE commonnamegroup_drugintclass
(
  druginteractionclassid int NOT NULL,
  commonnamegroupId int NOT NULL
);
CREATE TABLE commonnamegroup_indication
(
  indicationid int NOT NULL,
  commonnamegroupid int NOT NULL
);
CREATE TABLE commonnamegroup_precaution
(
  commonnamegroupId int NOT NULL,
  precautionid int NOT NULL
);
CREATE TABLE commonnamegroup_redun_molecule
(
  commonnamegroupid int NOT NULL,
  moleculeid int NOT NULL
);
CREATE TABLE commonnamegroup_route
(
  commonnamegroupId int NOT NULL,
  routeid int NOT NULL
);
CREATE TABLE commonnamegroup_sideeffect
(
  commonnamegroupid int NOT NULL,
  sideeffectid int NOT NULL,
  frequency int,
  sideeffectorder int
);
CREATE TABLE commonnamegroup_warning
(
  commonnamegroupid int NOT NULL,
  warningid int NOT NULL
);
CREATE TABLE contraindication
(
  contraindicationid int NOT NULL,
  name nvarchar(281) NOT NULL
);
CREATE TABLE country_mediatc
(
  idcountry int NOT NULL,
  name nvarchar(50)
);
CREATE TABLE druginteractionclass
(
  druginteractionclassid int NOT NULL,
  name nvarchar(281) NOT NULL
);
CREATE TABLE epp
(
  id_epp int NOT NULL,
  name nvarchar(55),
  unit_epp nchar(50)
);
CREATE TABLE equiv_atcclass
(
  atccode nvarchar(8) NOT NULL,
  who_final bit NOT NULL,
  who_temporary bit NOT NULL,
  atcclassname nvarchar(100),
  atcclassnamefrench nvarchar(120),
  atcclassnamespanish nvarchar(120),
  atcclassnamegerman nvarchar(120)
);
CREATE TABLE equiv_Company
(
  idCompany int NOT NULL,
  CompanyName nvarchar(200),
  idCountry int
);
CREATE TABLE equiv_country
(
  idcountry int NOT NULL,
  countrycode nvarchar(3),
  countrynamespanish nvarchar(55),
  idregion int
);
CREATE TABLE equiv_has_route
(
  idspe int NOT NULL,
  idstroute int NOT NULL
);
CREATE TABLE equiv_Is_Sold
(
  idSpe int NOT NULL,
  idCompany int NOT NULL
);
CREATE TABLE equiv_region
(
  idregion int NOT NULL,
  region nvarchar(55)
);
CREATE TABLE equiv_speciality
(
  idspe int NOT NULL,
  spename nvarchar(220),
  genname nvarchar(281),
  spenamelocal nvarchar(281),
  idcountry int,
  idstform int,
  atccode nvarchar(8)
);
CREATE TABLE equiv_spoken_language
(
  idlanguage int NOT NULL,
  languagenameenglish nvarchar(33),
  iso639_1 nvarchar(2),
  encoding nvarchar(15)
);
CREATE TABLE equiv_stform
(
  idstform int NOT NULL,
  stform nvarchar(77),
  default_stroute nvarchar(55),
  idstroute int
);
CREATE TABLE equiv_stform_glossary
(
  idstform int NOT NULL,
  idlanguage int NOT NULL,
  stlabel nvarchar(220)
);
CREATE TABLE equiv_stroute
(
  idstroute int NOT NULL,
  stroute nvarchar(55)
);
CREATE TABLE equiv_stroute_glossary
(
  idstroute int NOT NULL,
  idlanguage int NOT NULL,
  idstrlabel int,
  strlabel nvarchar(220)
);
CREATE TABLE galenicform
(
  formid int NOT NULL,
  parentid int,
  name nvarchar(281),
  FR bit
);
CREATE TABLE indication
(
  indicationid int NOT NULL,
  name nvarchar(281),
  name_noaccent nvarchar(281)
);
CREATE TABLE indicationgroup
(
  indicationgroupid int NOT NULL,
  name nvarchar(281)
);
CREATE TABLE indicationgroup_indication
(
  indicationgroupid int NOT NULL,
  indicationid int NOT NULL
);
CREATE TABLE interaction
(
  interactionid int NOT NULL,
  druginteractionclassid1 int NOT NULL,
  druginteractionclassid2 int NOT NULL,
  riskcomment nvarchar(1500),
  precautioncomment nvarchar(1500),
  severity int NOT NULL
);
CREATE TABLE interaction_gravity
(
  id_gravity int NOT NULL,
  name nvarchar(55)
);
CREATE TABLE mediatc
(
  code nvarchar(11) NOT NULL,
  pregnancy1t nvarchar(1),
  pregnancy2t nvarchar(1),
  pregnancy3t nvarchar(1),
  breastlevel int,
  drivingeffects nvarchar(300),
  adversereactions nvarchar(max),
  overdose nvarchar(max),
  photosensitivity bit,
  referencesmediatc nvarchar(max),
  actionmediatc nvarchar(max),
  name nvarchar(300),
  IR nvarchar(max),
  IH nvarchar(max),
  precbreastfeeding nvarchar(max),
  precpregnancy nvarchar(max),
  drivingeffectsrev nvarchar(max),
  countryid int,
  reviewed bit,
  indications nvarchar(max),
  posology nvarchar(max),
  indicaposol bit,
  contraindications nvarchar(max),
  precautions nvarchar(max),
  interactions nvarchar(max),
  fdalevel nvarchar(1)
);
CREATE TABLE molecule
(
  moleculeid int NOT NULL,
  name nvarchar(281),
  role int,
  name_noaccent nvarchar(281),
  FR bit
);
CREATE TABLE pe_epp
(
  precautionid int NOT NULL,
  epp int NOT NULL,
  min_value int,
  max_value int
);
CREATE TABLE precaution
(
  precautionid int NOT NULL,
  name nvarchar(281)
);
CREATE TABLE pregnancy_category_fda
(
  fdalevel nvarchar(1) NOT NULL,
  fdadefinition nvarchar(4000)
);
CREATE TABLE route
(
  routeid int NOT NULL,
  parentid int,
  name nvarchar(281),
  FR bit
);
CREATE TABLE sideeffect
(
  sideeffectid int NOT NULL,
  name nvarchar(281)
);
CREATE TABLE unit
(
  unit_Id int NOT NULL,
  name nvarchar(255)
);
CREATE TABLE warning
(
  warningid int NOT NULL,
  name nvarchar(281)
);
CREATE TABLE warning_epp
(
  warningid int NOT NULL,
  epp int NOT NULL,
  min_value int,
  max_value int
);



