
USE bihits;

-- Cria a tabela "RoomingNights"
CREATE TABLE RoomingNights (
    id CHAR(106) PRIMARY KEY,
    propertyId CHAR(136),
    originId INT,
    type VARCHAR(50),
    roomId INT,
    pax INT,
    chd INT,
    chdAge1 INT,
    chdAge2 INT,
    chdAge3 INT,
    chdAge4 INT,
    age5 INT,
    amount DECIMAL(10,2),
    endOfDayDate DATE,
    date DATE,
    dailyType VARCHAR(50),
    roomingNightCount INT,
    roomTypeId INT,
    version CHAR(36),
    requesterCity VARCHAR(100),
    companyId INT,
    companyName VARCHAR(255),
    companyTravelAgent BOOLEAN,
    companyTravelAgentId INT,
    companyTravelAgentName VARCHAR(255),
    requesterCountry VARCHAR(100),
    guestId INT,
    guestName VARCHAR(255),
    guestMail VARCHAR(255),
    guestPhone VARCHAR(50),
    guestCellPhone VARCHAR(50),
    mealPlanType VARCHAR(50),
    mealPlanAmountPaxChd DECIMAL(10,2),
    qtyAgeNotDefined INT,
    qtyEightyOneToNinety INT,
    qtyElevenToFifteen INT,
    qtyFemale INT,
    qtyFiftyOneToSixty INT,
    qtyFortyOneToFifty INT,
    qtyFromZeroToTen INT,
    qtyGenderNotDefined INT,
    qtyGreaterThanNinety INT,
    qtyMale INT,
    qtySeventyOneToEighty INT,
    qtySixteenToTwenty INT,
    qtySixtyOneToSeventy INT,
    qtyThirtyOneToForty INT,
    qtyTwentyOneToThirty INT,
    rateId INT,
    rateName VARCHAR(100),
    ratePlanId INT,
    ratePlanName VARCHAR(100),
    requesterState VARCHAR(100),
    requesterId INT,
    requesterName VARCHAR(255),
    requesterTravelAgent BOOLEAN,
    reservationChannelId VARCHAR(50),
    reservationChannelName VARCHAR(100),
    roomCode VARCHAR(50),
    roomTypeName VARCHAR(255),
    companyCity VARCHAR(100),
    companyCountry VARCHAR(100),
    companyState VARCHAR(100),
    guestCity VARCHAR(100),
    guestCountry VARCHAR(100),
    guestState VARCHAR(100),
    propertyName VARCHAR(255),
    managerId VARCHAR(50),
    managerName VARCHAR(100),
    marketSegmentId INT,
    marketSegmentName VARCHAR(100),
    purposeStay VARCHAR(100),
    purposeStayId INT,
    sourceChannelId INT,
    sourceChannelName VARCHAR(100),
    dateAdd DATETIME,
    companyMainDoc VARCHAR(50),
    companyMainDocType INT,
    dailyMonth INT,
    dailyYear INT,
    `group` BOOLEAN,
    groupName VARCHAR(255),
    guestMainDoc VARCHAR(50),
    guestMainDocType INT,
    originNumber VARCHAR(50),
    originType VARCHAR(50),
    requesterMainDoc VARCHAR(50),
    requesterMainDocType INT,
    reservationCreatedAt DATETIME,
    reservationCreatedUser VARCHAR(100),
    reservationCreatedUserId INT,
    dateCheckin DATE,
    dateCheckout DATE,
    voucher INT,
    reservationStatus INT,
    reservationStatusName VARCHAR(50),
    feeAmount DECIMAL(10,2),
    chdRange1 VARCHAR(50),
    chdRange2 VARCHAR(50),
    chdRange3 VARCHAR(50)
);