Create Match table as per details below. A player cannot play against himself
, so player1 should not be equal to player2.
Column Name Data Type
Constraint
Description
Mid
INTEGER
Unique Match Id for a tournament
PRIMARY KEY
Tid
INTEGER
FOREIGN KEY
Existing tournament Id present in tournament table
Player 1
INTEGER
FOREIGN KEY
Existing player Id present in player table
Player 1 should not be equal to Player2
Player2
INTEGER
FOREIGN KEY
Existing player Id present in player table
MatchDt
DATE
NOT NULL
Match Date
Winner
INTEGER
FOREIGN KEY
Existing player Id present in Player table
Score
VARCHAR2(30) NOT NULL
Match Score
N
Answers
Answered by
1
Answer:
पेजेजजेजेजेजेज्जेहहहयूयूएउ
Answered by
3
Explanation:
CREATE TABLE Match(
MId INTEGER,
TId INTEGER REFERENCES Tournament (TId),
PRIMARY KEY(MId,TId),
Player1 INTEGER REFERENCES Player(PId),
Player2 INTEGER REFERENCES Player(PId),
MatchDt DATE NOT NULL,
Winner INTEGER REFERENCES Player(PId),
Score VARCHAR2(30) NOT NULL,
CHECK (Player1<>Player2)
);
Similar questions
Math,
2 months ago
Math,
2 months ago
Math,
2 months ago
India Languages,
5 months ago
Computer Science,
5 months ago
Chemistry,
10 months ago
Math,
10 months ago