CREATE TABLE IF NOT EXISTS `CourseCour` ( 
`Id` int(11) NOT NULL AUTO_INCREMENT, 
`Name` TEXT  NOT NULL,
`Code` TEXT  NOT NULL,
`ShortDescription` TEXT  NOT NULL,
`Description` TEXT  NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARACTER SET `utf8`; 

CREATE TABLE IF NOT EXISTS `CourseLesson` ( 
`Id` int(11) NOT NULL AUTO_INCREMENT, 
`CourId` INT  NOT NULL,
`Name` TEXT  NOT NULL,
`Code` TEXT  NOT NULL,
`Description` TEXT  NOT NULL,
`Content` TEXT  NOT NULL,
PRIMARY KEY (`Id`),
CONSTRAINT `CourseCour_CourseLesson` FOREIGN KEY (`CourId`) REFERENCES `CourseCour`(`Id`)
) ENGINE=InnoDB  DEFAULT CHARACTER SET `utf8`; 

CREATE TABLE IF NOT EXISTS `CourseSession` ( 
`Id` int(11) NOT NULL AUTO_INCREMENT, 
`DateStart` DATE  NOT NULL,
`HourStart` TEXT  NOT NULL,
`HourEnd` TEXT  NOT NULL,
`Price` INT  NOT NULL,
`NumberPlaces` INT  NOT NULL,
`CourId` INT  NOT NULL,
`Hebdomadaire` INT  NOT NULL,
PRIMARY KEY (`Id`),
CONSTRAINT `CourseCour_CourseSession` FOREIGN KEY (`CourId`) REFERENCES `CourseCour`(`Id`)
) ENGINE=InnoDB  DEFAULT CHARACTER SET `utf8`; 

CREATE TABLE IF NOT EXISTS `CourseOrganizer` ( 
`Id` int(11) NOT NULL AUTO_INCREMENT, 
`Name` TEXT  NOT NULL,
`FirstName` TEXT  NOT NULL,
`Email` TEXT  NOT NULL,
`Phone` TEXT  NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARACTER SET `utf8`; 

CREATE TABLE IF NOT EXISTS `CourseSessionOrganizer` ( 
`Id` int(11) NOT NULL AUTO_INCREMENT, 
`SessionId` INT  NOT NULL,
`OrganizerId` INT  NOT NULL,
PRIMARY KEY (`Id`),
CONSTRAINT `CourseSession_CourseSessionOrganizer` FOREIGN KEY (`SessionId`) REFERENCES `CourseSession`(`Id`),
CONSTRAINT `CourseOrganizer_CourseSessionOrganizer` FOREIGN KEY (`OrganizerId`) REFERENCES `CourseOrganizer`(`Id`)
) ENGINE=InnoDB  DEFAULT CHARACTER SET `utf8`; 