diff --git a/MS1/SQL/Schema.sql b/MS1/SQL/Schema.sql index 62961d6..b66fded 100644 --- a/MS1/SQL/Schema.sql +++ b/MS1/SQL/Schema.sql @@ -1,10 +1,11 @@ +DROP TABLE BookingGuest; +DROP TABLE BookingRoom; +DROP TABLE Booking; DROP TABLE Adress; DROP TABLE Room; DROP TABLE Person; DROP TABLE Clerk; DROP TABLE Client; -DROP TABLE Booking; - CREATE TABLE Adress ( @@ -68,4 +69,12 @@ CREATE TABLE BookingGuest ( PRIMARY KEY(bookingId, personId) FOREIGN KEY (bookingId) REFERENCES Booking(bookindId), FOREIGN KEY (personId) REFERENCES Person(personId) +); + +CREATE TABLE BookingRoom ( + bookingId NUMBER NOT NULL, + roomNumber NUMBER NOT NULL, + PRIMARY KEY(bookingId, personId) + FOREIGN KEY (bookingId) REFERENCES Booking(bookindId), + FOREIGN KEY (roomNumber) REFERENCES Room(roomNumber) ); \ No newline at end of file