Northwind › Tables
EmployeeTerritories table
A junction table: which employee covers which sales territory (many-to-many). 49 rows.
Columns
| # | Name | Type | Not null | Default | Key | References |
|---|---|---|---|---|---|---|
| 0 | EmployeeID |
INTEGER |
yes | — | PK 1 | Employees.EmployeeID |
| 1 | TerritoryID |
TEXT |
yes | — | PK 2 | Territories.TerritoryID |
Indexes
| Name | Columns | Unique | Created by |
|---|---|---|---|
sqlite_autoindex_EmployeeTerritories_1 |
EmployeeID, TerritoryID |
yes | PRIMARY KEY |
Referenced by
No other table has a foreign key pointing at EmployeeTerritories.
Definition
CREATE TABLE EmployeeTerritories (
EmployeeID INTEGER NOT NULL REFERENCES Employees (EmployeeID),
TerritoryID TEXT NOT NULL REFERENCES Territories (TerritoryID),
PRIMARY KEY (EmployeeID, TerritoryID)
)