Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要使用 SQL 查询创建两个表,第一个表称为员工,第二个表称为部门。
如何创建表以强制从员工到部门的约束“多到 2”?
多对多,如一对多和多对一可以通过多种方式建模 -规范的方式是通过映射表:
员工
EmployeeID | Other | Employee | Fields
部门
DepartmentID | Other | Department | Fields
员工部
EmployeeID | DepartmentID