--Adhérants--
CREATE TABLE EPINOY_ADHERANT (
	idAdherant INTEGER,
	password VARCHAR (30),
	name VARCHAR (30),
	firstName VARCHAR (30),
	gender BOOLEAN,
	dateBirth DATE,
	district VARCHAR (30),
	zipCode INTEGER,
	mail VARCHAR (50),
	numPortable INTEGER,

	PRIMARY KEY (idAdherant)
);

--Utilisateur--
CREATE TABLE EPINOY_USER (
	idUser INTEGER,
	userPassword VARCHAR (30),
	
	PRIMARY KEY (idUser),
	FOREIGN KEY (idAdherant) REFERENCES EPINOY_ADHERANT (idAdherant)
	
);
	
--Search = 0 --
CREATE TABLE EPINOY_SEARCH (
	idSearch INTEGER,
	service VARCHAR (75),

	PRIMARY KEY (idSearch),
	FOREIGN KEY (idAdherant) REFERENCES EPINOY_ADHERANT (idAdherant)
);

--Services--
CREATE TABLE EPINOY_SERVICES (
	idServices INTEGER,
	offer BOOLEAN,
	descServices VARCHAR (100),
	dateStart DATE,
	dateEnd DATE,
	idType INTEGER,
	
	PRIMARY KEY (idServices),
	FOREIGN KEY (idType) REFERENCES EPINOY_TYPESERVICES (idType)
);
	
--Type Services--
CREATE TABLE EPINOY_TYPESERVICES (
	idType INTEGER,
	
	PRIMARY KEY (idType),
);
	
--Evènements--	
CREATE TABLE EPINOY_EVENT (
	idEvent INTEGER,
	present BOOLEAN,
	
	PRIMARY KEY (idEvent),
	FOREIGN KEY (idAdherant) REFERENCES EPINOY_ADHERANT (idAdherant)
);



	