I am trying to create this Oracle SQL table with the following parameters:
This is my current SQL query:
CREATE TABLE Match
(
MId INTEGER,
TId INTEGER CONSTRAINT tid REFERENCES Tournament(tid),
Player1 INTEGER CONSTRAINT ply1 REFERENCES Player(ply1),
Player2 INTEGER CONSTRAINT ply2 REFERENCES Player(ply2),
MatchDt DATE NOT NULL,
Winner INTEGER CONSTRAINT win REFERENCES Player(win),
Score VARCHAR2(30) NOT NULL,
CONSTRAINT marks_cid_pk PRIMARY KEY(MId, TId),
CONSTRAINT columns_cannot_equal CHECK (Player1 <> Player2)
);
I get this error
ORA-00904: "PLY1": invalid identifier
Not sure why it is wrong. Any help is appreciated.
I have tried to rename the values and reorder it but to no avail