Northwind database

Microsoft sample database

Database server: server1
Database size: 4.25 MB
Documentation date: 11/08/2008

Tables (14) Views (16 ) Stored procedures (7)
dbo.Categories
dbo.CustomerCustomerDemo
dbo.CustomerDemographics
dbo.Customers (dbdesc demo)
dbo.Employees (dbdesc demo)
dbo.EmployeeTerritories (dbdesc demo)
dbo.Order Details (dbdesc demo)
dbo.Orders (dbdesc demo)
dbo.Products (dbdesc demo)
dbo.Region (dbdesc demo)
dbo.Shippers (dbdesc demo)
dbo.Suppliers (dbdesc demo)
dbo.Territories (dbdesc demo)
dbo.TestTable (dbdesc demo)
dbo.Alphabetical list of products
dbo.Category Sales for 1997
dbo.Current Product List
dbo.Customer and Suppliers by City
dbo.Invoices
dbo.Order Details Extended
dbo.Order Subtotals
dbo.Orders Qry
dbo.Product Sales for 1997
dbo.Products Above Average Price
dbo.Products by Category
dbo.Quarterly Orders
dbo.Sales by Category
dbo.Sales Totals by Amount
dbo.Summary of Sales by Quarter
dbo.Summary of Sales by Year
dbo.CustOrderHist
dbo.CustOrdersDetail
dbo.CustOrdersOrders
dbo.Employee Sales by Country
dbo.Sales by Year
dbo.SalesByCategory
dbo.Ten Most Expensive Products

User defined data types (1) Users (2) Roles (10)
TestType
dbo
guest
db_accessadmin
db_backupoperator
db_datareader
db_datawriter
db_ddladmin
db_denydatareader
db_denydatawriter
db_owner
db_securityadmin
public


(up)

Table: dbo.Categories

List of categories
Field nameData typeNullableDefault valueDescription
PK CategoryIDintCategories of Northwind products.
IX CategoryNamenvarchar (15) Name of food category.
DescriptionntextYesFull description of the category. Provide samples.
PictureimageYesA picture representing the food category.

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
CategoryNameCategoryNameASCNONCLUSTERED
PK_CategoriesCategoryIDASCYesCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Extended properties

AuthorJohn Smith
CustomProperty1Sample value to test extended properties

Objects that depend on dbo.Categories

dbo.Alphabetical list of products
dbo.Product Sales for 1997
dbo.Products by Category
dbo.Sales by Category
dbo.SalesByCategory

Table definition

CREATE TABLE [dbo].[Categories] (
	[CategoryID] [int] IDENTITY (1, 1) NOT NULL ,
	[CategoryName] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[Description] [ntext] COLLATE Modern_Spanish_CI_AS NULL ,
	[Picture] [image] NULL ,
	CONSTRAINT [PK_Categories] PRIMARY KEY  CLUSTERED 
	(
		[CategoryID]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO




(up)

Table: dbo.CustomerCustomerDemo

Test description
Field nameData typeNullableDefault valueDescription
PK FKCustomerIDnchar (5) 234
PK FKCustomerTypeIDnchar (10) 234

Foreign keys dependencies:

FK_CustomerCustomerDemo_Customers: CustomerID relies upon remote PK_Customers (dbo.Customers)
FK_CustomerCustomerDemo: CustomerTypeID relies upon remote PK_CustomerDemographics (dbo.CustomerDemographics)

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
PK_CustomerCustomerDemoCustomerIDASCYesNONCLUSTERED
CustomerTypeIDASCYesNONCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Table definition

CREATE TABLE [dbo].[CustomerCustomerDemo] (
	[CustomerID] [nchar] (5) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[CustomerTypeID] [nchar] (10) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	CONSTRAINT [PK_CustomerCustomerDemo] PRIMARY KEY  NONCLUSTERED 
	(
		[CustomerID],
		[CustomerTypeID]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_CustomerCustomerDemo] FOREIGN KEY 
	(
		[CustomerTypeID]
	) REFERENCES [dbo].[CustomerDemographics] (
		[CustomerTypeID]
	),
	CONSTRAINT [FK_CustomerCustomerDemo_Customers] FOREIGN KEY 
	(
		[CustomerID]
	) REFERENCES [dbo].[Customers] (
		[CustomerID]
	)
) ON [PRIMARY]
GO




(up)

Table: dbo.CustomerDemographics

Sample annotation for table CustomerDemographics
Field nameData typeNullableDefault valueDescription
PK CustomerTypeIDnchar (10) 123465
CustomerDescntextYessdfg

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
PK_CustomerDemographicsCustomerTypeIDASCYesNONCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Table definition

CREATE TABLE [dbo].[CustomerDemographics] (
	[CustomerTypeID] [nchar] (10) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[CustomerDesc] [ntext] COLLATE Modern_Spanish_CI_AS NULL ,
	CONSTRAINT [PK_CustomerDemographics] PRIMARY KEY  NONCLUSTERED 
	(
		[CustomerTypeID]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO




(up)

Table: dbo.Customers (dbdesc demo)

Customers' names and related data
Field nameData typeNullableDefault valueDescription
PK CustomerIDnchar (5) Unique five-character code based on customer name.
IX CompanyNamenvarchar (40) sdfg
ContactNamenvarchar (30) Yessdg
ContactTitlenvarchar (30) Yessdfg
Addressnvarchar (60) YesStreet or post-office box.
IX Citynvarchar (15) Yes
IX Regionnvarchar (15) YesState or province.
IX PostalCodenvarchar (10) Yes
Countrynvarchar (15) Yes
Phonenvarchar (24) YesPhone number includes country code or area code.
Faxnvarchar (24) YesPhone number includes country code or area code.

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
CityCityASCNONCLUSTERED
CompanyNameCompanyNameASCNONCLUSTERED
IX_CustomersCompanyNameASCNONCLUSTERED
PK_CustomersCustomerIDASCYesCLUSTERED
PostalCodePostalCodeASCNONCLUSTERED
RegionRegionASCNONCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Extended properties

AuthorJohn Smith
CustomProperty1Sample value to test extended properties

Objects that depend on dbo.Customers (dbdesc demo)

dbo.Customer and Suppliers by City
dbo.CustOrderHist
dbo.Invoices
dbo.Orders Qry
dbo.Quarterly Orders
dbo.Sales Totals by Amount

Table definition

CREATE TABLE [dbo].[Customers] (
	[CustomerID] [nchar] (5) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[CompanyName] [nvarchar] (40) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[ContactName] [nvarchar] (30) COLLATE Modern_Spanish_CI_AS NULL ,
	[ContactTitle] [nvarchar] (30) COLLATE Modern_Spanish_CI_AS NULL ,
	[Address] [nvarchar] (60) COLLATE Modern_Spanish_CI_AS NULL ,
	[City] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[Region] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[PostalCode] [nvarchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
	[Country] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[Phone] [nvarchar] (24) COLLATE Modern_Spanish_CI_AS NULL ,
	[Fax] [nvarchar] (24) COLLATE Modern_Spanish_CI_AS NULL ,
	CONSTRAINT [PK_Customers] PRIMARY KEY  CLUSTERED 
	(
		[CustomerID]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO




(up)

Table: dbo.Employees (dbdesc demo)

Employees' names, titles, and personal information.
Field nameData typeNullableDefault valueDescription
PK EmployeeIDintNumber automatically assigned to new employee.
IX LastNamenvarchar (20)
FirstNamenvarchar (10)
Titlenvarchar (30) YesEmployee's title.
TitleOfCourtesynvarchar (25) Yes
BirthDatedatetimeYes
HireDatedatetimeYes
Addressnvarchar (60) Yes Street or post-office box.
Citynvarchar (15) Yes
Regionnvarchar (15) YesStreet or post-office box.
IX PostalCodenvarchar (10) Yes
Countrynvarchar (15) Yes
HomePhonenvarchar (24) YesPhone number includes country code or area code.
Extensionnvarchar (4) Yes Internal telephone extension number.
PhotoimageYesPicture of employee.
NotesntextYesGeneral information about employee's background.
FK ReportsTointYes Employee's supervisor.
PhotoPathnvarchar (255) Yes

Foreign keys dependencies:

FK_Employees_Employees: ReportsTo relies upon remote PK_Employees (dbo.Employees)

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
LastNameLastNameASCNONCLUSTERED
PK_EmployeesEmployeeIDASCYesCLUSTERED
PostalCodeASCNONCLUSTERED

Check constraints

Check nameColumn nameCheck expresion
CK_BirthdateBirthDate([BirthDate] < getdate())

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Objects that depend on dbo.Employees (dbdesc demo)

dbo.Employee Sales by Country
dbo.Invoices

Table definition

CREATE TABLE [dbo].[Employees] (
	[EmployeeID] [int] IDENTITY (1, 1) NOT NULL ,
	[LastName] [nvarchar] (20) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[FirstName] [nvarchar] (10) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[Title] [nvarchar] (30) COLLATE Modern_Spanish_CI_AS NULL ,
	[TitleOfCourtesy] [nvarchar] (25) COLLATE Modern_Spanish_CI_AS NULL ,
	[BirthDate] [datetime] NULL ,
	[HireDate] [datetime] NULL ,
	[Address] [nvarchar] (60) COLLATE Modern_Spanish_CI_AS NULL ,
	[City] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[Region] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[PostalCode] [nvarchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
	[Country] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[HomePhone] [nvarchar] (24) COLLATE Modern_Spanish_CI_AS NULL ,
	[Extension] [nvarchar] (4) COLLATE Modern_Spanish_CI_AS NULL ,
	[Photo] [image] NULL ,
	[Notes] [ntext] COLLATE Modern_Spanish_CI_AS NULL ,
	[ReportsTo] [int] NULL ,
	[PhotoPath] [nvarchar] (255) COLLATE Modern_Spanish_CI_AS NULL ,
	CONSTRAINT [PK_Employees] PRIMARY KEY  CLUSTERED 
	(
		[EmployeeID]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_Employees_Employees] FOREIGN KEY 
	(
		[ReportsTo]
	) REFERENCES [dbo].[Employees] (
		[EmployeeID]
	),
	CONSTRAINT [CK_Birthdate] CHECK ([BirthDate] < getdate())
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO




(up)

Table: dbo.EmployeeTerritories (dbdesc demo)


Field nameData typeNullableDefault valueDescription
PK FKEmployeeIDint
PK FKTerritoryIDnvarchar (20)

Foreign keys dependencies:

FK_EmployeeTerritories_Employees: EmployeeID relies upon remote PK_Employees (dbo.Employees)
FK_EmployeeTerritories_Territories: TerritoryID relies upon remote PK_Territories (dbo.Territories)

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
PK_EmployeeTerritoriesEmployeeIDASCYesNONCLUSTERED
TerritoryIDASCYesNONCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Table definition

CREATE TABLE [dbo].[EmployeeTerritories] (
	[EmployeeID] [int] NOT NULL ,
	[TerritoryID] [nvarchar] (20) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	CONSTRAINT [PK_EmployeeTerritories] PRIMARY KEY  NONCLUSTERED 
	(
		[EmployeeID],
		[TerritoryID]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_EmployeeTerritories_Employees] FOREIGN KEY 
	(
		[EmployeeID]
	) REFERENCES [dbo].[Employees] (
		[EmployeeID]
	),
	CONSTRAINT [FK_EmployeeTerritories_Territories] FOREIGN KEY 
	(
		[TerritoryID]
	) REFERENCES [dbo].[Territories] (
		[TerritoryID]
	)
) ON [PRIMARY]
GO




(up)

Table: dbo.Order Details (dbdesc demo)

Details on products, quantities, and prices for each order in the Orders table.
Field nameData typeNullableDefault valueDescription
PK FKOrderIDintSame as Order ID in Orders table.
PK FKProductIDintSame as Product ID in Products table.
UnitPricemoney(0)
Quantitysmallint(1)
Discountreal(0)

Foreign keys dependencies:

FK_Order_Details_Orders: OrderID relies upon remote PK_Orders (dbo.Orders)
FK_Order_Details_Products: ProductID relies upon remote PK_Products (dbo.Products)

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
OrderIDOrderIDASCNONCLUSTERED
OrdersOrder_DetailsOrderIDASCNONCLUSTERED
PK_Order_DetailsOrderIDASCYesCLUSTERED
ProductIDASCYesCLUSTERED
ProductIDProductIDASCNONCLUSTERED
ProductsOrder_DetailsProductIDASCNONCLUSTERED

Check constraints

Check nameColumn nameCheck expresion
CK_DiscountDiscount([Discount] >= 0 and [Discount] <= 1)
CK_QuantityQuantity([Quantity] > 0)
CK_UnitPriceUnitPrice([UnitPrice] >= 0)

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Objects that depend on dbo.Order Details (dbdesc demo)

dbo.CustOrderHist
dbo.CustOrdersDetail
dbo.Invoices
dbo.Order Details Extended
dbo.Order Subtotals
dbo.Product Sales for 1997
dbo.SalesByCategory

Table definition

CREATE TABLE [dbo].[Order Details] (
	[OrderID] [int] NOT NULL ,
	[ProductID] [int] NOT NULL ,
	[UnitPrice] [money] NOT NULL CONSTRAINT [DF_Order_Details_UnitPrice] DEFAULT (0),
	[Quantity] [smallint] NOT NULL CONSTRAINT [DF_Order_Details_Quantity] DEFAULT (1),
	[Discount] [real] NOT NULL CONSTRAINT [DF_Order_Details_Discount] DEFAULT (0),
	CONSTRAINT [PK_Order_Details] PRIMARY KEY  CLUSTERED 
	(
		[OrderID],
		[ProductID]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_Order_Details_Orders] FOREIGN KEY 
	(
		[OrderID]
	) REFERENCES [dbo].[Orders] (
		[OrderID]
	),
	CONSTRAINT [FK_Order_Details_Products] FOREIGN KEY 
	(
		[ProductID]
	) REFERENCES [dbo].[Products] (
		[ProductID]
	),
	CONSTRAINT [CK_Discount] CHECK ([Discount] >= 0 and [Discount] <= 1),
	CONSTRAINT [CK_Quantity] CHECK ([Quantity] > 0),
	CONSTRAINT [CK_UnitPrice] CHECK ([UnitPrice] >= 0)
) ON [PRIMARY]
GO




(up)

Table: dbo.Orders (dbdesc demo)

Customer name, order date, and freight charge for each order.
Field nameData typeNullableDefault valueDescription
PK OrderIDint
FK CustomerIDnchar (5) Yes
FK EmployeeIDintYesSame entry as in Employees table.
IX OrderDatedatetimeYes
RequiredDatedatetimeYes
IX ShippedDatedatetimeYes
FK ShipViaintYesSame as Shipper ID in Shippers table.
FreightmoneyYes(0)
ShipNamenvarchar (40) YesName of person or company to receive the shipment.
ShipAddressnvarchar (60) YesStreet address only -- no post-office box allowed.
ShipCitynvarchar (15) Yes
ShipRegionnvarchar (15) YesState or province.
IX ShipPostalCodenvarchar (10) Yes
ShipCountrynvarchar (15) Yes

Foreign keys dependencies:

FK_Orders_Customers: CustomerID relies upon remote PK_Customers (dbo.Customers)
FK_Orders_Employees: EmployeeID relies upon remote PK_Employees (dbo.Employees)
FK_Orders_Shippers: ShipVia relies upon remote PK_Shippers (dbo.Shippers)

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
CustomerIDCustomerIDASCNONCLUSTERED
CustomersOrdersCustomerIDASCNONCLUSTERED
EmployeeIDEmployeeIDASCNONCLUSTERED
EmployeesOrdersEmployeeIDASCNONCLUSTERED
OrderDateOrderDateASCNONCLUSTERED
PK_OrdersOrderIDASCYesCLUSTERED
ShippedDateShippedDateASCNONCLUSTERED
ShippersOrdersShipViaASCNONCLUSTERED
ShipPostalCodeShipPostalCodeASCNONCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Objects that depend on dbo.Orders (dbdesc demo)

dbo.CustOrderHist
dbo.CustOrdersOrders
dbo.Employee Sales by Country
dbo.Invoices
dbo.Orders Qry
dbo.Product Sales for 1997
dbo.Quarterly Orders
dbo.Sales by Category
dbo.Sales by Year
dbo.Sales Totals by Amount
dbo.SalesByCategory
dbo.Summary of Sales by Quarter
dbo.Summary of Sales by Year

Table definition

CREATE TABLE [dbo].[Orders] (
	[OrderID] [int] IDENTITY (1, 1) NOT NULL ,
	[CustomerID] [nchar] (5) COLLATE Modern_Spanish_CI_AS NULL ,
	[EmployeeID] [int] NULL ,
	[OrderDate] [datetime] NULL ,
	[RequiredDate] [datetime] NULL ,
	[ShippedDate] [datetime] NULL ,
	[ShipVia] [int] NULL ,
	[Freight] [money] NULL CONSTRAINT [DF_Orders_Freight] DEFAULT (0),
	[ShipName] [nvarchar] (40) COLLATE Modern_Spanish_CI_AS NULL ,
	[ShipAddress] [nvarchar] (60) COLLATE Modern_Spanish_CI_AS NULL ,
	[ShipCity] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[ShipRegion] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[ShipPostalCode] [nvarchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
	[ShipCountry] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	CONSTRAINT [PK_Orders] PRIMARY KEY  CLUSTERED 
	(
		[OrderID]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_Orders_Customers] FOREIGN KEY 
	(
		[CustomerID]
	) REFERENCES [dbo].[Customers] (
		[CustomerID]
	),
	CONSTRAINT [FK_Orders_Employees] FOREIGN KEY 
	(
		[EmployeeID]
	) REFERENCES [dbo].[Employees] (
		[EmployeeID]
	),
	CONSTRAINT [FK_Orders_Shippers] FOREIGN KEY 
	(
		[ShipVia]
	) REFERENCES [dbo].[Shippers] (
		[ShipperID]
	)
) ON [PRIMARY]
GO




(up)

Table: dbo.Products (dbdesc demo)

Product names, suppliers, prices, and units in stock.
Field nameData typeNullableDefault valueDescription
PK ProductIDintNumber automatically assigned to new product.
IX ProductNamenvarchar (40)
FK SupplierIDintYesSame entry as in Suppliers table.
FK CategoryIDintYesSame entry as in Categories table.
QuantityPerUnitnvarchar (20) Yes(e.g., 24-count case, 1-liter bottle).
UnitPricemoneyYes(0)
UnitsInStocksmallintYes(0)
UnitsOnOrdersmallintYes(0)
ReorderLevelsmallintYes(0)Minimum units to maintain in stock.
Discontinuedbit(0)Yes means item is no longer available.

Foreign keys dependencies:

FK_Products_Suppliers: SupplierID relies upon remote PK_Suppliers (dbo.Suppliers)
FK_Products_Categories: CategoryID relies upon remote PK_Categories (dbo.Categories)

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
CategoriesProductsCategoryIDASCNONCLUSTERED
CategoryIDCategoryIDASCNONCLUSTERED
PK_ProductsProductIDASCYesCLUSTERED
ProductNameProductNameASCNONCLUSTERED
SupplierIDSupplierIDASCNONCLUSTERED
SuppliersProductsSupplierIDASCNONCLUSTERED

Check constraints

Check nameColumn nameCheck expresion
CK_Products_UnitPriceUnitPrice([UnitPrice] >= 0)
CK_ReorderLevelReorderLevel([ReorderLevel] >= 0)
CK_UnitsInStockUnitsInStock([UnitsInStock] >= 0)
CK_UnitsOnOrderUnitsOnOrder([UnitsOnOrder] >= 0)

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Objects that depend on dbo.Products (dbdesc demo)

dbo.Alphabetical list of products
dbo.Current Product List
dbo.CustOrderHist
dbo.CustOrdersDetail
dbo.Invoices
dbo.Order Details Extended
dbo.Product Sales for 1997
dbo.Products Above Average Price
dbo.Products by Category
dbo.Sales by Category
dbo.SalesByCategory
dbo.Ten Most Expensive Products

Table definition

CREATE TABLE [dbo].[Products] (
	[ProductID] [int] IDENTITY (1, 1) NOT NULL ,
	[ProductName] [nvarchar] (40) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[SupplierID] [int] NULL ,
	[CategoryID] [int] NULL ,
	[QuantityPerUnit] [nvarchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
	[UnitPrice] [money] NULL CONSTRAINT [DF_Products_UnitPrice] DEFAULT (0),
	[UnitsInStock] [smallint] NULL CONSTRAINT [DF_Products_UnitsInStock] DEFAULT (0),
	[UnitsOnOrder] [smallint] NULL CONSTRAINT [DF_Products_UnitsOnOrder] DEFAULT (0),
	[ReorderLevel] [smallint] NULL CONSTRAINT [DF_Products_ReorderLevel] DEFAULT (0),
	[Discontinued] [bit] NOT NULL CONSTRAINT [DF_Products_Discontinued] DEFAULT (0),
	CONSTRAINT [PK_Products] PRIMARY KEY  CLUSTERED 
	(
		[ProductID]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_Products_Categories] FOREIGN KEY 
	(
		[CategoryID]
	) REFERENCES [dbo].[Categories] (
		[CategoryID]
	),
	CONSTRAINT [FK_Products_Suppliers] FOREIGN KEY 
	(
		[SupplierID]
	) REFERENCES [dbo].[Suppliers] (
		[SupplierID]
	),
	CONSTRAINT [CK_Products_UnitPrice] CHECK ([UnitPrice] >= 0),
	CONSTRAINT [CK_ReorderLevel] CHECK ([ReorderLevel] >= 0),
	CONSTRAINT [CK_UnitsInStock] CHECK ([UnitsInStock] >= 0),
	CONSTRAINT [CK_UnitsOnOrder] CHECK ([UnitsOnOrder] >= 0)
) ON [PRIMARY]
GO




(up)

Table: dbo.Region (dbdesc demo)

Sample comment add to test dbdesc This is the second line
Field nameData typeNullableDefault valueDescription
PK RegionIDint
RegionDescriptionnchar (50)

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
PK_RegionRegionIDASCYesNONCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Table definition

CREATE TABLE [dbo].[Region] (
	[RegionID] [int] NOT NULL ,
	[RegionDescription] [nchar] (50) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	CONSTRAINT [PK_Region] PRIMARY KEY  NONCLUSTERED 
	(
		[RegionID]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO




(up)

Table: dbo.Shippers (dbdesc demo)

Shippers' names and phone numbers.
Field nameData typeNullableDefault valueDescription
PK ShipperIDint Number automatically assigned to new shipper.
CompanyNamenvarchar (40) Name of shipping company.
Phonenvarchar (24) YesPhone number includes country code or area code.

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
PK_ShippersShipperIDASCYesCLUSTERED

Objects that depend on dbo.Shippers (dbdesc demo)

dbo.Invoices

Table definition

CREATE TABLE [dbo].[Shippers] (
	[ShipperID] [int] IDENTITY (1, 1) NOT NULL ,
	[CompanyName] [nvarchar] (40) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[Phone] [nvarchar] (24) COLLATE Modern_Spanish_CI_AS NULL ,
	CONSTRAINT [PK_Shippers] PRIMARY KEY  CLUSTERED 
	(
		[ShipperID]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO




(up)

Table: dbo.Suppliers (dbdesc demo)

Suppliers' names, addresses, phone numbers, and hyperlinks to home pages.
Field nameData typeNullableDefault valueDescription
PK SupplierIDintNumber automatically assigned to new supplier.
IX CompanyNamenvarchar (40)
ContactNamenvarchar (30) Yes
ContactTitlenvarchar (30) Yes
Addressnvarchar (60) YesStreet or post-office box.
Citynvarchar (15) Yes
Regionnvarchar (15) YesState or province.
IX PostalCodenvarchar (10) Yes
Countrynvarchar (15) Yes
Phonenvarchar (24) YesPhone number includes country code or area code.
Faxnvarchar (24) YesPhone number includes country code or area code.
HomePagentextYesSupplier's home page on World Wide Web.

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
CompanyNameASCNONCLUSTERED
PK_SuppliersSupplierIDASCYesCLUSTERED
PostalCodeASCNONCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Objects that depend on dbo.Suppliers (dbdesc demo)

dbo.Customer and Suppliers by City

Table definition

CREATE TABLE [dbo].[Suppliers] (
	[SupplierID] [int] IDENTITY (1, 1) NOT NULL ,
	[CompanyName] [nvarchar] (40) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[ContactName] [nvarchar] (30) COLLATE Modern_Spanish_CI_AS NULL ,
	[ContactTitle] [nvarchar] (30) COLLATE Modern_Spanish_CI_AS NULL ,
	[Address] [nvarchar] (60) COLLATE Modern_Spanish_CI_AS NULL ,
	[City] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[Region] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[PostalCode] [nvarchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
	[Country] [nvarchar] (15) COLLATE Modern_Spanish_CI_AS NULL ,
	[Phone] [nvarchar] (24) COLLATE Modern_Spanish_CI_AS NULL ,
	[Fax] [nvarchar] (24) COLLATE Modern_Spanish_CI_AS NULL ,
	[HomePage] [ntext] COLLATE Modern_Spanish_CI_AS NULL ,
	CONSTRAINT [PK_Suppliers] PRIMARY KEY  CLUSTERED 
	(
		[SupplierID]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO




(up)

Table: dbo.Territories (dbdesc demo)

sdfsf
Field nameData typeNullableDefault valueDescription
PK TerritoryIDnvarchar (20) sdfg
TerritoryDescriptionnchar (50) sdfg
FK RegionIDintsdfg

Foreign keys dependencies:

FK_Territories_Region: RegionID relies upon remote PK_Region (dbo.Region)

Indexes

Index nameColumn nameSort directionIs uniqueIndex type
PK_TerritoriesTerritoryIDASCYesNONCLUSTERED

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrantgrant

Table definition

CREATE TABLE [dbo].[Territories] (
	[TerritoryID] [nvarchar] (20) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[TerritoryDescription] [nchar] (50) COLLATE Modern_Spanish_CI_AS NOT NULL ,
	[RegionID] [int] NOT NULL ,
	CONSTRAINT [PK_Territories] PRIMARY KEY  NONCLUSTERED 
	(
		[TerritoryID]
	)  ON [PRIMARY] ,
	CONSTRAINT [FK_Territories_Region] FOREIGN KEY 
	(
		[RegionID]
	) REFERENCES [dbo].[Region] (
		[RegionID]
	)
) ON [PRIMARY]
GO




(up)

Table: dbo.TestTable (dbdesc demo)

This is a test table 2
Field nameData typeNullableDefault valueDescription
TestCustomFieldTestType (20) Yessdcs

Table definition

CREATE TABLE [dbo].[TestTable] (
	[TestCustomField] [TestType] NULL 
) ON [PRIMARY]
GO




(up)

View: dbo.Alphabetical list of products ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Resultset

Source Field name Data type Nullable Field description
dbo.Products (TABLE)ProductIDint
dbo.Products (TABLE)ProductNamenvarchar (40)
dbo.Products (TABLE)SupplierIDintYes
dbo.Products (TABLE)CategoryIDintYes
dbo.Products (TABLE)QuantityPerUnitnvarchar (20) Yes
dbo.Products (TABLE)UnitPricemoneyYes
dbo.Products (TABLE)UnitsInStocksmallintYes
dbo.Products (TABLE)UnitsOnOrdersmallintYes
dbo.Products (TABLE)ReorderLevelsmallintYes
dbo.Products (TABLE)Discontinuedbit
dbo.Categories (TABLE)CategoryNamenvarchar (15)

View definition
create view "Alphabetical list of products" AS
SELECT Products.*, Categories.CategoryName
FROM Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID
WHERE (((Products.Discontinued)=0))

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Products
dbo.Categories


(up)

View: dbo.Category Sales for 1997 ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Totals product sales by category based on values returned by the Product Sales for 1997 query.

Resultset

Source Field name Data type Nullable Field description
dbo.Product Sales for 1997 (VIEW)CategoryNamenvarchar (15) CatName
CategorySalesmoneyYesCatSales

View definition
create view "Category Sales for 1997" AS
SELECT "Product Sales for 1997".CategoryName, Sum("Product Sales for 1997".ProductSales) AS CategorySales
FROM "Product Sales for 1997"
GROUP BY "Product Sales for 1997".CategoryName

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Product Sales for 1997


(up)

View: dbo.Current Product List ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Filters records in Products table; query returns only products that are not discontinued.

Resultset

Source Field name Data type Nullable Field description
dbo.Products (TABLE)ProductIDint
dbo.Products (TABLE)ProductNamenvarchar (40)

View definition
create view "Current Product List" AS
SELECT Product_List.ProductID, Product_List.ProductName
FROM Products AS Product_List
WHERE (((Product_List.Discontinued)=0))
--ORDER BY Product_List.ProductName

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Products


(up)

View: dbo.Customer and Suppliers by City ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Resultset

Source Field name Data type Nullable Field description
dbo.Customers (TABLE)Citynvarchar (15) Yes
dbo.Customers (TABLE)CompanyNamenvarchar (40)
dbo.Customers (TABLE)ContactNamenvarchar (30) Yes
Relationshipvarchar (9)

View definition
create view "Customer and Suppliers by City" AS
SELECT City, CompanyName, ContactName, 'Customers' AS Relationship 
FROM Customers
UNION SELECT City, CompanyName, ContactName, 'Suppliers'
FROM Suppliers
--ORDER BY City, CompanyName

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Suppliers
dbo.Customers


(up)

View: dbo.Invoices ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

(Criteria) Record source for Invoice report. Based on six tables. Includes expressions that concatenate first and last employee name and that use the CCur function to calculate extended price.

Resultset

Source Field name Data type Nullable Field description
dbo.Orders (TABLE)ShipNamenvarchar (40) YesName of the shipper
dbo.Orders (TABLE)ShipAddressnvarchar (60) Yes
dbo.Orders (TABLE)ShipCitynvarchar (15) Yes
dbo.Orders (TABLE)ShipRegionnvarchar (15) Yes
dbo.Orders (TABLE)ShipPostalCodenvarchar (10) Yes
dbo.Orders (TABLE)ShipCountrynvarchar (15) Yes
dbo.Orders (TABLE)CustomerIDnchar (5) Yes
CustomerNamenvarchar (40)
dbo.Customers (TABLE)Addressnvarchar (60) Yes
dbo.Customers (TABLE)Citynvarchar (15) Yes
dbo.Customers (TABLE)Regionnvarchar (15) Yes
dbo.Customers (TABLE)PostalCodenvarchar (10) Yes
dbo.Customers (TABLE)Countrynvarchar (15) Yes
Salespersonnvarchar (31)
dbo.Orders (TABLE)OrderIDint
dbo.Orders (TABLE)OrderDatedatetimeYes
dbo.Orders (TABLE)RequiredDatedatetimeYes
dbo.Orders (TABLE)ShippedDatedatetimeYes
ShipperNamenvarchar (40)
dbo.Products (TABLE)ProductIDint
dbo.Products (TABLE)ProductNamenvarchar (40)
dbo.Order Details (TABLE)UnitPricemoney
dbo.Order Details (TABLE)Quantitysmallint
dbo.Order Details (TABLE)Discountreal
ExtendedPricemoneyYes
dbo.Orders (TABLE)FreightmoneyYes

View definition
create view Invoices AS
SELECT Orders.ShipName, Orders.ShipAddress, Orders.ShipCity, Orders.ShipRegion, Orders.ShipPostalCode, 
	Orders.ShipCountry, Orders.CustomerID, Customers.CompanyName AS CustomerName, Customers.Address, Customers.City, 
	Customers.Region, Customers.PostalCode, Customers.Country, 
	(FirstName + ' ' + LastName) AS Salesperson, 
	Orders.OrderID, Orders.OrderDate, Orders.RequiredDate, Orders.ShippedDate, Shippers.CompanyName As ShipperName, 
	"Order Details".ProductID, Products.ProductName, "Order Details".UnitPrice, "Order Details".Quantity, 
	"Order Details".Discount, 
	(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)100))*100) AS ExtendedPrice, Orders.Freight
FROM 	Shippers INNER JOIN 
		(Products INNER JOIN 
			(
				(Employees INNER JOIN 
					(Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID) 
				ON Employees.EmployeeID = Orders.EmployeeID) 
			INNER JOIN "Order Details" ON Orders.OrderID = "Order Details".OrderID) 
		ON Products.ProductID = "Order Details".ProductID) 
	ON Shippers.ShipperID = Orders.ShipVia

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Customers
dbo.Shippers
dbo.Employees
dbo.Order Details
dbo.Products
dbo.Orders


(up)

View: dbo.Order Details Extended ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Record source for several forms and reports. Uses CCur function to compute the ExtendedPrice for each item ordered.

Resultset

Source Field name Data type Nullable Field description
dbo.Order Details (TABLE)OrderIDint
dbo.Products (TABLE)ProductIDint
dbo.Products (TABLE)ProductNamenvarchar (40)
dbo.Order Details (TABLE)UnitPricemoney
dbo.Order Details (TABLE)Quantitysmallint
dbo.Order Details (TABLE)Discountreal
ExtendedPricemoneyYes

View definition
create view "Order Details Extended" AS
SELECT "Order Details".OrderID, "Order Details".ProductID, Products.ProductName, 
	"Order Details".UnitPrice, "Order Details".Quantity, "Order Details".Discount, 
	(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)100))*100) AS ExtendedPrice
FROM Products INNER JOIN "Order Details" ON Products.ProductID = "Order Details".ProductID
--ORDER BY "Order Details".OrderID

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Order Details
dbo.Products

Objects that depend on dbo.Order Details Extended

dbo.Sales by Category


(up)

View: dbo.Order Subtotals ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Record source for other queries. Uses Sum and CCur functions to compute subtotal for each order.

Resultset

Source Field name Data type Nullable Field description
dbo.Order Details (TABLE)OrderIDint
SubtotalmoneyYes

View definition
create view "Order Subtotals" AS
SELECT "Order Details".OrderID, Sum(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)100))*100) AS Subtotal
FROM "Order Details"
GROUP BY "Order Details".OrderID

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Order Details

Objects that depend on dbo.Order Subtotals

dbo.Employee Sales by Country
dbo.Sales by Year
dbo.Sales Totals by Amount
dbo.Summary of Sales by Quarter
dbo.Summary of Sales by Year


(up)

View: dbo.Orders Qry ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Resultset

Source Field name Data type Nullable Field description
dbo.Orders (TABLE)OrderIDint
dbo.Orders (TABLE)CustomerIDnchar (5) Yes
dbo.Orders (TABLE)EmployeeIDintYes
dbo.Orders (TABLE)OrderDatedatetimeYes
dbo.Orders (TABLE)RequiredDatedatetimeYes
dbo.Orders (TABLE)ShippedDatedatetimeYes
dbo.Orders (TABLE)ShipViaintYes
dbo.Orders (TABLE)FreightmoneyYes
dbo.Orders (TABLE)ShipNamenvarchar (40) Yes
dbo.Orders (TABLE)ShipAddressnvarchar (60) Yes
dbo.Orders (TABLE)ShipCitynvarchar (15) Yes
dbo.Orders (TABLE)ShipRegionnvarchar (15) Yes
dbo.Orders (TABLE)ShipPostalCodenvarchar (10) Yes
dbo.Orders (TABLE)ShipCountrynvarchar (15) Yes
dbo.Customers (TABLE)CompanyNamenvarchar (40)
dbo.Customers (TABLE)Addressnvarchar (60) Yes
dbo.Customers (TABLE)Citynvarchar (15) Yes
dbo.Customers (TABLE)Regionnvarchar (15) Yes
dbo.Customers (TABLE)PostalCodenvarchar (10) Yes
dbo.Customers (TABLE)Countrynvarchar (15) Yes

View definition
create view "Orders Qry" AS
SELECT Orders.OrderID, Orders.CustomerID, Orders.EmployeeID, Orders.OrderDate, Orders.RequiredDate, 
	Orders.ShippedDate, Orders.ShipVia, Orders.Freight, Orders.ShipName, Orders.ShipAddress, Orders.ShipCity, 
	Orders.ShipRegion, Orders.ShipPostalCode, Orders.ShipCountry, 
	Customers.CompanyName, Customers.Address, Customers.City, Customers.Region, Customers.PostalCode, Customers.Country
FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Customers
dbo.Orders


(up)

View: dbo.Product Sales for 1997 ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Record source for Category Sales for 1997 query. Uses Sum and CCur functions.

Resultset

Source Field name Data type Nullable Field description
dbo.Categories (TABLE)CategoryNamenvarchar (15)
dbo.Products (TABLE)ProductNamenvarchar (40)
ProductSalesmoneyYes

View definition
create view "Product Sales for 1997" AS
SELECT Categories.CategoryName, Products.ProductName, 
Sum(CONVERT(money,("Order Details".UnitPrice*Quantity*(1-Discount)100))*100) AS ProductSales
FROM (Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID) 
	INNER JOIN (Orders 
		INNER JOIN "Order Details" ON Orders.OrderID = "Order Details".OrderID) 
	ON Products.ProductID = "Order Details".ProductID
WHERE (((Orders.ShippedDate) Between '19970101' And '19971231'))
GROUP BY Categories.CategoryName, Products.ProductName

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Order Details
dbo.Categories
dbo.Products
dbo.Orders

Objects that depend on dbo.Product Sales for 1997

dbo.Category Sales for 1997


(up)

View: dbo.Products Above Average Price ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

(Subquery) Returns products that have a unit price higher than the average.

Resultset

Source Field name Data type Nullable Field description
dbo.Products (TABLE)ProductNamenvarchar (40)
dbo.Products (TABLE)UnitPricemoneyYes

View definition
create view "Products Above Average Price" AS
SELECT Products.ProductName, Products.UnitPrice
FROM Products
WHERE Products.UnitPrice>(SELECT AVG(UnitPrice) From Products)
--ORDER BY Products.UnitPrice DESC

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Products


(up)

View: dbo.Products by Category ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Resultset

Source Field name Data type Nullable Field description
dbo.Categories (TABLE)CategoryNamenvarchar (15)
dbo.Products (TABLE)ProductNamenvarchar (40)
dbo.Products (TABLE)QuantityPerUnitnvarchar (20) Yes
dbo.Products (TABLE)UnitsInStocksmallintYes
dbo.Products (TABLE)Discontinuedbit

View definition
create view "Products by Category" AS
SELECT Categories.CategoryName, Products.ProductName, Products.QuantityPerUnit, Products.UnitsInStock, Products.Discontinued
FROM Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID
WHERE Products.Discontinued <> 1
--ORDER BY Categories.CategoryName, Products.ProductName

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Categories
dbo.Products


(up)

View: dbo.Quarterly Orders ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Record source for Quarterly Orders form. Lists only customers who had orders in 1995.

Resultset

Source Field name Data type Nullable Field description
dbo.Orders (TABLE)CustomerIDnchar (5) Yes
dbo.Customers (TABLE)CompanyNamenvarchar (40) Yes
dbo.Customers (TABLE)Citynvarchar (15) Yes
dbo.Customers (TABLE)Countrynvarchar (15) Yes

View definition
create view "Quarterly Orders" AS
SELECT DISTINCT Customers.CustomerID, Customers.CompanyName, Customers.City, Customers.Country
FROM Customers RIGHT JOIN Orders ON Customers.CustomerID = Orders.CustomerID
WHERE Orders.OrderDate BETWEEN '19970101' And '19971231'

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Customers
dbo.Orders


(up)

View: dbo.Sales by Category ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Record source for Sales by Category report.

Resultset

Source Field name Data type Nullable Field description
dbo.Products (TABLE)CategoryIDint
dbo.Categories (TABLE)CategoryNamenvarchar (15)
dbo.Products (TABLE)ProductNamenvarchar (40)
ProductSalesmoneyYes

View definition
create view "Sales by Category" AS
SELECT Categories.CategoryID, Categories.CategoryName, Products.ProductName, 
	Sum("Order Details Extended".ExtendedPrice) AS ProductSales
FROM 	Categories INNER JOIN 
		(Products INNER JOIN 
			(Orders INNER JOIN "Order Details Extended" ON Orders.OrderID = "Order Details Extended".OrderID) 
		ON Products.ProductID = "Order Details Extended".ProductID) 
	ON Categories.CategoryID = Products.CategoryID
WHERE Orders.OrderDate BETWEEN '19970101' And '19971231'
GROUP BY Categories.CategoryID, Categories.CategoryName, Products.ProductName
--ORDER BY Products.ProductName

Object permissions

User / RoleSELECTINSERTUPDATEDELETEEXECUTEDRI
publicgrantgrantgrantgrant

Related objects

dbo.Categories
dbo.Products
dbo.Orders
dbo.Order Details Extended


(up)

View: dbo.Sales Totals by Amount ( Created: 06 Ago 2000 Last altered: 06 Ago 2000 )

Resultset

Source Field name Data type Nullable Field description
SaleAmountmoneyYes
dbo.Orders (TABLE)OrderIDint
dbo.Customers (TABLE)CompanyNamenvarchar (40)
dbo.Orders (TABLE)ShippedDatedatetimeYes

View definition
create view "Sales Totals by Amount" AS
SELECT "Order Subtotals".Subtotal AS SaleAmount, Orders.OrderID, Customers.CompanyName, Orders.ShippedDate
FROM 	Customers INNER JOIN 
		(Orders INNER JOIN "Order Subtotals" ON Orders.OrderID = "Order Subtotals".OrderID)