SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

CREATE SCHEMA IF NOT EXISTS `hotelservices` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `hotelservices`;

-- -----------------------------------------------------
-- Table `hotelservices`.`Vendeg`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Vendeg` (
  `idVendeg` INT NOT NULL ,
  `FelhasznaloNev` VARCHAR(45) NULL ,
  `Jelszo` VARCHAR(45) NULL ,
  `Nev` VARCHAR(45) NULL ,
  `Iranyitoszam` INT NULL ,
  `Cim` VARCHAR(45) NULL ,
  `Telefonszam` VARCHAR(45) NULL ,
  PRIMARY KEY (`idVendeg`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Szakacs`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Szakacs` (
  `idSzakacs` INT NOT NULL ,
  `FelhasznaloNev` VARCHAR(45) NULL ,
  `Jelszo` VARCHAR(45) NULL ,
  `Nev` VARCHAR(45) NULL ,
  `Iranyitoszam` INT NULL ,
  `Cim` VARCHAR(45) NULL ,
  `Telefonszam` VARCHAR(45) NULL ,
  PRIMARY KEY (`idSzakacs`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Etel`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Etel` (
  `idEtel` INT NOT NULL ,
  `Nap` VARCHAR(45) NULL ,
  `Menu` VARCHAR(45) NULL ,
  `Eloetel` VARCHAR(45) NULL ,
  `Foetel` VARCHAR(45) NULL ,
  `Desszert` VARCHAR(45) NULL ,
  `Szakacs_idSzakacs` INT NULL ,
  PRIMARY KEY (`idEtel`) ,
  INDEX `fk_Etel_Szakacs` (`Szakacs_idSzakacs` ASC) ,
  CONSTRAINT `fk_Etel_Szakacs`
    FOREIGN KEY (`Szakacs_idSzakacs` )
    REFERENCES `hotelservices`.`Szakacs` (`idSzakacs` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Szoba`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Szoba` (
  `idSzoba` INT NOT NULL ,
  `Ferohely` INT NULL ,
  `Ar_Ejszaka` INT NULL ,
  PRIMARY KEY (`idSzoba`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Etel_Vendeg`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Etel_Vendeg` (
  `idEtel_Vendeg` INT NOT NULL ,
  `Fo` INT NULL ,
  `Etel_idEtel` INT NULL ,
  `Vendeg_idVendeg` INT NULL ,
  PRIMARY KEY (`idEtel_Vendeg`) ,
  INDEX `fk_Etel_Vendeg_Etel` (`Etel_idEtel` ASC) ,
  INDEX `fk_Etel_Vendeg_Vendeg` (`Vendeg_idVendeg` ASC) ,
  CONSTRAINT `fk_Etel_Vendeg_Etel`
    FOREIGN KEY (`Etel_idEtel` )
    REFERENCES `hotelservices`.`Etel` (`idEtel` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_Etel_Vendeg_Vendeg`
    FOREIGN KEY (`Vendeg_idVendeg` )
    REFERENCES `hotelservices`.`Vendeg` (`idVendeg` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Szallodavezeto`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Szallodavezeto` (
  `idSzallodavezeto` INT NOT NULL ,
  `FelhasznaloNev` VARCHAR(45) NULL ,
  `Jelszo` VARCHAR(45) NULL ,
  `Nev` VARCHAR(45) NULL ,
  `Iranyitoszam` INT NULL ,
  `Cim` VARCHAR(45) NULL ,
  `Telefonszam` VARCHAR(45) NULL ,
  PRIMARY KEY (`idSzallodavezeto`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Programok`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Programok` (
  `idProgramok` INT NOT NULL ,
  `Programnev` VARCHAR(45) NULL ,
  `Idopont` VARCHAR(45) NULL ,
  `Ido` VARCHAR(45) NULL ,
  `Szallodavezeto_idSzallodavezeto` INT NULL ,
  PRIMARY KEY (`idProgramok`) ,
  INDEX `fk_Programok_Szallodavezeto` (`Szallodavezeto_idSzallodavezeto` ASC) ,
  CONSTRAINT `fk_Programok_Szallodavezeto`
    FOREIGN KEY (`Szallodavezeto_idSzallodavezeto` )
    REFERENCES `hotelservices`.`Szallodavezeto` (`idSzallodavezeto` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Programok_Vendeg`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Programok_Vendeg` (
  `idProgramok_Vendeg` INT NOT NULL ,
  `Fo` INT NULL ,
  `Vendeg_idVendeg` INT NULL ,
  `Programok_idProgramok` INT NULL ,
  PRIMARY KEY (`idProgramok_Vendeg`) ,
  INDEX `fk_Programok_Vendeg_Vendeg` (`Vendeg_idVendeg` ASC) ,
  INDEX `fk_Programok_Vendeg_Programok` (`Programok_idProgramok` ASC) ,
  CONSTRAINT `fk_Programok_Vendeg_Vendeg`
    FOREIGN KEY (`Vendeg_idVendeg` )
    REFERENCES `hotelservices`.`Vendeg` (`idVendeg` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_Programok_Vendeg_Programok`
    FOREIGN KEY (`Programok_idProgramok` )
    REFERENCES `hotelservices`.`Programok` (`idProgramok` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Takaritas`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Takaritas` (
  `idTakaritas` INT NOT NULL ,
  `Szobaszam` INT NULL ,
  `Leiras` VARCHAR(500) NULL ,
  `Vendeg_idVendeg` INT NULL ,
  PRIMARY KEY (`idTakaritas`) ,
  INDEX `fk_Takaritas_Vendeg` (`Vendeg_idVendeg` ASC) ,
  CONSTRAINT `fk_Takaritas_Vendeg`
    FOREIGN KEY (`Vendeg_idVendeg` )
    REFERENCES `hotelservices`.`Vendeg` (`idVendeg` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Szoba_Vendeg`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Szoba_Vendeg` (
  `idSzoba_Vendeg` INT NOT NULL ,
  `Napok` INT NULL ,
  `Szoba_idSzoba` INT NULL ,
  `Vendeg_idVendeg` INT NULL ,
  PRIMARY KEY (`idSzoba_Vendeg`) ,
  INDEX `fk_Szoba_Vendeg_Szoba` (`Szoba_idSzoba` ASC) ,
  INDEX `fk_Szoba_Vendeg_Vendeg` (`Vendeg_idVendeg` ASC) ,
  CONSTRAINT `fk_Szoba_Vendeg_Szoba`
    FOREIGN KEY (`Szoba_idSzoba` )
    REFERENCES `hotelservices`.`Szoba` (`idSzoba` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_Szoba_Vendeg_Vendeg`
    FOREIGN KEY (`Vendeg_idVendeg` )
    REFERENCES `hotelservices`.`Vendeg` (`idVendeg` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Recepcios`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Recepcios` (
  `idRecepcios` INT NOT NULL ,
  `FelhasznaloNev` VARCHAR(45) NULL ,
  `Jelszo` VARCHAR(45) NULL ,
  `Nev` VARCHAR(45) NULL ,
  `Iranyitoszam` INT NULL ,
  `Cim` VARCHAR(45) NULL ,
  `Telefonszam` VARCHAR(45) NULL ,
  PRIMARY KEY (`idRecepcios`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `hotelservices`.`Takarito`
-- -----------------------------------------------------
CREATE  TABLE IF NOT EXISTS `hotelservices`.`Takarito` (
  `idTakarito` INT NOT NULL ,
  `FelhasznaloNev` VARCHAR(45) NULL ,
  `Jelszo` VARCHAR(45) NULL ,
  `Nev` VARCHAR(45) NULL ,
  `Iranyitoszam` INT NULL ,
  `Cim` VARCHAR(45) NULL ,
  `Telefonszam` VARCHAR(45) NULL ,
  PRIMARY KEY (`idTakarito`) )
ENGINE = InnoDB;



SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
