I have 2 tables, one of them has 2 foreign keys and another has 2 composite foreign keys in it. Whenever I try to run the query, it says error and could not create constraint or index. So I have two tables here.
I know I'm completely wrong, I apologize for that as I'm kind of new to coding.
create table Booking
(
BookingID char(4) primary key,
dateBooked datetime not null,
creditCard char(16) null,
expiryDate datetime not null,
CVC char (3) not null,
confirmationID char(4) not null,
ticketType varchar(20)
foreign key references ticketType(ticketType),
NRIC char(9)
foreign key references Patron(NRIC)
)
create table BookingSeat
(
seatNo char(2) not null,
rowNo char(2) not null,
date datetime not null,
startTime time not null,
rowNo char(2) not null,
seatNo char(2) not null,
foreign key (date, startTime)
references hallSchedule(date, startTime),
foreign key (rowNo, seatNo)
references Seat(rowNo, seatNo)
)