I have created the following two tables for use in a history classroom setting. These tables will contain data about wars throughout history and the nations that were a part of them.
My problem is that the Wars
table is not in 3NF because of the multiple values in the Combatants
field, as there can be many combatants (i.e. nations) in a war.
How do I change this schema to 3NF without creating any artificial keys (i.e. only using the fields that I currently have)?
CREATE TABLE Wars (
Name CHAR(50) PRIMARY KEY,
StartingDate DATE NOT NULL,
EndingDate DATE NOT NULL,
Cause CHAR(50) NOT NULL,
Combatants CHAR(50) NOT NULL,
TodaysDate DATE DEFAULT SYSDATE,
CONSTRAINT CHK_TD CHECK(EndingDate < TodaysDate),
CONSTRAINT CHK_SD CHECK(StartingDate > 0);
CREATE TABLE Nations (
Name CHAR(50) PRIMARY KEY,
StartingDate DATE NOT NULL,
EndingDate DATE,
TodaysDate DATE DEFAULT SYSDATE,
CONSTRAINT CHK_TD CHECK(EndingDate < TodaysDate);