Northwind Database Schema

Table dbo.Categories

Name Type Nullable Comment
CategoryID PK int NOT NULL IDENTITY
CategoryName nvarchar (15) NOT NULL
Description ntext NULL
Picture image NULL


Table dbo.CustomerCustomerDemo

Name Type Nullable Comment
CustomerID PK nchar (5) NOT NULL -> dbo.Customers.CustomerID
CustomerTypeID PK nchar (10) NOT NULL -> dbo.CustomerDemographics.CustomerTypeID


Table dbo.CustomerDemographics

Name Type Nullable Comment
CustomerTypeID PK nchar (10) NOT NULL
CustomerDesc ntext NULL


Table dbo.Customers

Name Type Nullable Comment
CustomerID PK nchar (5) NOT NULL
CompanyName nvarchar (40) NOT NULL
ContactName nvarchar (30) NULL
ContactTitle nvarchar (30) NULL
Address nvarchar (60) NULL
City nvarchar (15) NULL
Region nvarchar (15) NULL
PostalCode nvarchar (10) NULL
Country nvarchar (15) NULL
Phone nvarchar (24) NULL
Fax nvarchar (24) NULL


Table dbo.Employees

Name Type Nullable Comment
EmployeeID PK int NOT NULL IDENTITY
LastName nvarchar (20) NOT NULL
FirstName nvarchar (10) NOT NULL
Title nvarchar (30) NULL
TitleOfCourtesy nvarchar (25) NULL
BirthDate datetime NULL
HireDate datetime NULL
Address nvarchar (60) NULL
City nvarchar (15) NULL
Region nvarchar (15) NULL
PostalCode nvarchar (10) NULL
Country nvarchar (15) NULL
HomePhone nvarchar (24) NULL
Extension nvarchar (4) NULL
Photo image NULL
Notes ntext NULL
ReportsTo int NULL -> dbo.Employees.EmployeeID
PhotoPath nvarchar (255) NULL


Table dbo.EmployeeTerritories

Name Type Nullable Comment
EmployeeID PK int NOT NULL -> dbo.Employees.EmployeeID
TerritoryID PK nvarchar (20) NOT NULL -> dbo.Territories.TerritoryID


Table dbo.Order Details

Name Type Nullable Comment
OrderID PK int NOT NULL -> dbo.Orders.OrderID
ProductID PK int NOT NULL -> dbo.Products.ProductID
UnitPrice money (19, 4) NOT NULL DEFAULT ((0))
Quantity smallint NOT NULL DEFAULT ((1))
Discount real (24, 0) NOT NULL DEFAULT ((0))


Table dbo.Orders

Name Type Nullable Comment
OrderID PK int NOT NULL IDENTITY
CustomerID nchar (5) NULL -> dbo.Customers.CustomerID
EmployeeID int NULL -> dbo.Employees.EmployeeID
OrderDate datetime NULL
RequiredDate datetime NULL
ShippedDate datetime NULL
ShipVia int NULL -> dbo.Shippers.ShipperID
Freight money (19, 4) NULL DEFAULT ((0))
ShipName nvarchar (40) NULL
ShipAddress nvarchar (60) NULL
ShipCity nvarchar (15) NULL
ShipRegion nvarchar (15) NULL
ShipPostalCode nvarchar (10) NULL
ShipCountry nvarchar (15) NULL


Table dbo.Products

Name Type Nullable Comment
ProductID PK int NOT NULL IDENTITY
ProductName nvarchar (40) NOT NULL
SupplierID int NULL -> dbo.Suppliers.SupplierID
CategoryID int NULL -> dbo.Categories.CategoryID
QuantityPerUnit nvarchar (20) NULL
UnitPrice money (19, 4) NULL DEFAULT ((0))
UnitsInStock smallint NULL DEFAULT ((0))
UnitsOnOrder smallint NULL DEFAULT ((0))
ReorderLevel smallint NULL DEFAULT ((0))
Discontinued bit NOT NULL DEFAULT ((0))


Table dbo.Region

Name Type Nullable Comment
RegionID PK int NOT NULL
RegionDescription nchar (50) NOT NULL


Table dbo.Shippers

Name Type Nullable Comment
ShipperID PK int NOT NULL IDENTITY
CompanyName nvarchar (40) NOT NULL
Phone nvarchar (24) NULL


Table dbo.Suppliers

Name Type Nullable Comment
SupplierID PK int NOT NULL IDENTITY
CompanyName nvarchar (40) NOT NULL
ContactName nvarchar (30) NULL
ContactTitle nvarchar (30) NULL
Address nvarchar (60) NULL
City nvarchar (15) NULL
Region nvarchar (15) NULL
PostalCode nvarchar (10) NULL
Country nvarchar (15) NULL
Phone nvarchar (24) NULL
Fax nvarchar (24) NULL
HomePage ntext NULL


Table dbo.Territories

Name Type Nullable Comment
TerritoryID PK nvarchar (20) NOT NULL
TerritoryDescription nchar (50) NOT NULL
RegionID int NOT NULL -> dbo.Region.RegionID


Last edited Jan 26, 2011 at 10:34 PM by altair, version 1

Comments

No comments yet.