SQL - Table Relationships
You have these tables:
If a team is deleted, what happens to the players belonging to that team? And what happens if the TeamID is updated in Teams?
CREATE TABLE Teams (TeamID INT PRIMARY KEY);
CREATE TABLE Players (PlayerID INT PRIMARY KEY, TeamID INT, FOREIGN KEY (TeamID) REFERENCES Teams(TeamID) ON DELETE SET NULL ON UPDATE CASCADE);
If a team is deleted, what happens to the players belonging to that team? And what happens if the TeamID is updated in Teams?
