A foreign key constrain needs to point to the primary key of the foreign table.
The
RowID
column is not the primary key of the
room_row_seat
table. Instead, you have a composite primary key, consisting of the
RoomId
,
RowId
, and
SeatId
columns.
Therefore, your FK relationship needs to use all three columns to refer to the foreign table.
Those need to be part of a single FK relationship,
not three separate FK relationships as you currently have.
CONSTRAINT `FK_tickets1_seat` FOREIGN KEY (`RoomID`, `RowID`, `SeatID`) REFERENCES `prime_cinema_Final`.`room_row_seat` (`RoomID`, `RowID`, `SeatID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
NB: You'll almost certainly have the same problem with the FK relationship to the
movie_timings
table - you're currently trying to define four separate relationships to that table, rather than a single FK relationship based on a composite primary key.