CREATE DATABASE Hotel;
USE Hotel;

CREATE TABLE Guest(
    Id INT PRIMARY KEY IDENTITY(1,1),
    name VARCHAR(255) NOT NULL,
    email VARCHAR(255) NOT NULL,
    phone VARCHAR(255) NOT NULL
);

CREATE TABLE Room(
    Id INT PRIMARY KEY IDENTITY(1,1),
    type VARCHAR(255) NOT NULL,
    capacity int NOT NULL,
    price INT NOT NULL
);

CREATE TABLE Reservation(
    Id INT PRIMARY KEY IDENTITY(1,1),
    guestId INT NOT NULL,
    roomId INT NOT NULL,
    checkIn DATE NOT NULL,
    checkOut DATE NOT NULL,
    paid BOOLEAN NOT NULL,
    FOREIGN KEY (guestId) REFERENCES Guest(Id),
    FOREIGN KEY (roomId) REFERENCES Room(Id)
);

CREATE TABLE Payment(
    Id INT PRIMARY KEY IDENTITY(1,1),
    reservationId INT NOT NULL,
    amount INT NOT NULL,
    serviceId INT NOT NULL,
    FOREIGN KEY (reservationId) REFERENCES Reservation(Id),
    FOREIGN KEY (serviceId) REFERENCES Service(Id)
);

CREATE TABLE Service(
    Id INT PRIMARY KEY IDENTITY(1,1),
    name VARCHAR(255) NOT NULL,
    description VARCHAR(255) NOT NULL,
    price INT NOT NULL
);



