add table BookingRoom

This commit is contained in:
Timo Ley 2023-04-27 15:29:39 +00:00
parent 17acbca619
commit 72941b5ef9

View file

@ -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)
);