How do we give constraint on foreign key column based on ERD cardinality?
问题 Let's say I have a 2 tables like below : Department : DeptId Name Employee : EmpId Name DeptId Here I have a 0-to-many relationship between Department and Employee table. Now when I read the relationship from Department to Employee , it says 1 department can have 0 or more employees. Does this mean while creating Employee table, I will set DepartmentId (foreign key) as null due to zero or many relationship? And how do we represent 1 or many relationship like for eg If relationship in ERD says