SQL - Table Relationships
Consider this table design:
What is missing to enforce a one-to-one relationship between
CREATE TABLE Employee ( EmployeeID INT PRIMARY KEY, Name VARCHAR(50) ); CREATE TABLE EmployeeDetails ( DetailID INT PRIMARY KEY, EmployeeID INT, Address VARCHAR(100), FOREIGN KEY (EmployeeID) REFERENCES Employee(EmployeeID) );
What is missing to enforce a one-to-one relationship between
Employee and EmployeeDetails?