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 つのテーブルがあります。最初のテーブルは Employees と呼ばれ、2 番目のテーブルは Departments と呼ばれます。
従業員から部門への制約「多対 2」を強制するテーブルを作成するにはどうすればよいですか?
多対多は、1 対多や多対 1 のように、いくつかの方法でモデル化できます。標準的な方法は、マッピング テーブルを使用することです。
従業員
EmployeeID | Other | Employee | Fields
デパートメント
DepartmentID | Other | Department | Fields
従業員部門
EmployeeID | DepartmentID