SQL - Table Relationships
You have two tables:
If a department is deleted, what happens to employees linked to that department?
CREATE TABLE Departments (DeptID INT PRIMARY KEY, DeptName VARCHAR(50));CREATE TABLE Employees (EmpID INT PRIMARY KEY, EmpName VARCHAR(50), DeptID INT, FOREIGN KEY (DeptID) REFERENCES Departments(DeptID) ON DELETE SET NULL);If a department is deleted, what happens to employees linked to that department?
