CREATE TABLE Club(
  id_Club NUMBER,
  nom VARCHAR2(20),
  adresse VARCHAR2(255),
  ville VARCHAR2(20),
  anneedecreation INT,
  PRIMARY KEY(id_Club)
);

CREATE TABLE Club_has_Competition(
  Club_id_Club NUMBER,
  Competition_id_Competition NUMBER,
  PRIMARY KEY(Club_id_Club, Competition_id_Competition),
  CONSTRAINT fk_Club_id_Club FOREIGN KEY (Club_id_Club) REFERENCES Club,
  CONSTRAINT fk_Competition_id_Competition FOREIGN KEY (Competition_id_Competition) REFERENCES Competition
);

CREATE TABLE Competition(
  id_Competition NUMBER,
  adresse VARCHAR2(255),
  ville VARCHAR2(20),
  date2 DATE,
  division VARCHAR2(20),
  PRIMARY KEY(id_Competition)
);

CREATE TABLE Equipe(
  id_Equipe NUMBER,
  Club_id_Club NUMBER,
  nom VARCHAR2(20),
  engin VARCHAR2(20),
  categorie VARCHAR2(20),
  PRIMARY KEY(id_Equipe),
  CONSTRAINT fk_gymnaste_numlicence FOREIGN KEY (Club_id_Club)REFERENCES Club
);

CREATE TABLE Gymnaste(
  numlicence NUMBER,
  Equipe_id_Equipe NUMBER,
  nom VARCHAR2(20),
  prenom VARCHAR2(20),
  anneedenaissance INT,
  PRIMARY KEY(numlicence),
  CONSTRAINT fk_Equipe_id_Equipe FOREIGN KEY (Equipe_id_Equipe)REFERENCES Equipe
);

