I need to create a table TEAMS
and create a constraint that the coach (TeamCoachName
) can just be a coach for just 1 team (TeamName
).
/* Table number 2: Teams */
CREATE TABLE TEAMS
(
TeamName VARCHAR(255) UNIQUE,
YearOfFounding INT,
TeamOwnerName VARCHAR(255),
StadiumName VARCHAR(255),
GeographicArea VARCHAR(255)
CHECK (GeographicArea IN ('North','Central','South')),
TeamCoachName VARCHAR(255),
CONSTRAINT Names UNIQUE (TeamName, TeamCoachName),
CONSTRAINT OneTeamCoach
)