From ba714637a1bfaf2760f61eb112dde431077aeee0 Mon Sep 17 00:00:00 2001 From: Jiganesh Patil <67581447+Jiganesh@users.noreply.github.com> Date: Mon, 26 Jul 2021 23:20:15 +0530 Subject: [PATCH] Update Exercise-5.txt I checked your query in INFYTQ it doesn't work The query is under Exercise 3 inside the DDL Statements module. I have written the correct query Please Accept. --- DBMS/Day-2/Exercise-5.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/DBMS/Day-2/Exercise-5.txt b/DBMS/Day-2/Exercise-5.txt index a14490c..bfd4b78 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, - 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 playler_id_ck CHECK(Player1 <> Player2) -) \ No newline at end of file +CREATE TABLE Match ( + MId INTEGER, + TId INTEGER REFERENCES Tournament(TId), + Player1 INTEGER REFERENCES Player(PId), + Player2 INTEGER REFERENCES Player(PID), + MatchDt DATE NOT NULL, + Winner INTEGER REFERENCES Player(PID), + Score VARCHAR(30) NOT NULL, + CONSTRAINT match_mid_tid_pk PRIMARY KEY (MId, TID), + CONSTRAINT player_id_ck CHECK(Player1 <> Player2) +);