From 15263a302acde4e409ab1b0cc116741ceab38bae Mon Sep 17 00:00:00 2001 From: Shashank Kumar <74102663+shashank25412@users.noreply.github.com> Date: Mon, 21 Jun 2021 21:23:03 +0530 Subject: [PATCH] Update Exercise-5.txt As mentioned in the problem we, need to make a composite primary key with MId and TId. --- DBMS/Day-2/Exercise-5.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DBMS/Day-2/Exercise-5.txt b/DBMS/Day-2/Exercise-5.txt index a14490c..8f7fb70 100644 --- a/DBMS/Day-2/Exercise-5.txt +++ b/DBMS/Day-2/Exercise-5.txt @@ -1,10 +1,11 @@ CREATE TABLE Match( - MId INTEGER PRIMARY KEY, + MId INTEGER, TId INTEGER REFERENCES Tournament(TournamentId), Player1 INTEGER REFERENCES Player(PlayerId), Player2 INTEGER REFERENCES Player(PlayerId), MatchDt DATE NOT NULL, Winner INTEGER REFERENCES Player(PlayerId), Score VARCHAR2(30) NOT NULL, + CONSTRAINT match_pk PRIMARY KEY(MId,TId), CONSTRAINT playler_id_ck CHECK(Player1 <> Player2) -) \ No newline at end of file +)