Generated using SQL Data Dictionary demo version.
(Last updated on Thu, Nov 26th, 2015 at 12:26 PM)
AdventureWorks 2014 Sample OLTP Database
dbo.AWBuildVersion
(1 row)
Current version number of the AdventureWorks 2014 sample database. |
Production.ProductModelProductDescriptionCulture
(762 rows)
Cross-reference table mapping product descriptions and the language the description is written in. |
dbo.DatabaseLog
(1,597 rows)
Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog. |
Production.ProductPhoto
(101 rows)
Product images. |
dbo.ErrorLog
(0 rows)
Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct. |
Production.ProductProductPhoto
(504 rows)
Cross-reference table mapping products and product photos. |
HumanResources.Department
(16 rows)
Lookup table containing the departments within the Adventure Works Cycles company. |
Production.ProductReview
(4 rows)
Customer reviews of products they have purchased. |
HumanResources.Employee
(290 rows)
Employee information such as salary, department, and title. |
Production.ProductSubcategory
(37 rows)
Product subcategories. See ProductCategory table. |
HumanResources.EmployeeDepartmentHistory
(296 rows)
Employee department transfers. |
Production.ScrapReason
(16 rows)
Manufacturing failure reasons lookup table. |
HumanResources.EmployeePayHistory
(316 rows)
Employee pay history. |
Production.TransactionHistory
(113,443 rows)
Record of each purchase order, sales order, or work order transaction year to date. |
HumanResources.JobCandidate
(13 rows)
Résumés submitted to Human Resources by job applicants. |
Production.TransactionHistoryArchive
(89,253 rows)
Transactions for previous years. |
HumanResources.Shift
(3 rows)
Work shift lookup table. |
Production.UnitMeasure
(38 rows)
Unit of measure lookup table. |
Person.Address
(19,614 rows)
Street address information for customers, employees, and vendors. |
Production.WorkOrder
(72,591 rows)
Manufacturing work orders. |
Person.AddressType
(6 rows)
Types of addresses stored in the Address table. |
Production.WorkOrderRouting
(67,131 rows)
Work order details. |
Person.BusinessEntity
(20,777 rows)
Source of the ID that connects vendors, customers, and employees with address and contact information. |
Purchasing.ProductVendor
(460 rows)
Cross-reference table mapping vendors with the products they supply. |
Person.BusinessEntityAddress
(19,614 rows)
Cross-reference table mapping customers, vendors, and employees to their addresses. |
Purchasing.PurchaseOrderDetail
(8,845 rows)
Individual products associated with a specific purchase order. See PurchaseOrderHeader. |
Person.BusinessEntityContact
(909 rows)
Cross-reference table mapping stores, vendors, and employees to people |
Purchasing.PurchaseOrderHeader
(4,012 rows)
General purchase order information. See PurchaseOrderDetail. |
Person.ContactType
(20 rows)
Lookup table containing the types of business entity contacts. |
Purchasing.ShipMethod
(5 rows)
Shipping company lookup table. |
Person.CountryRegion
(238 rows)
Lookup table containing the ISO standard codes for countries and regions. |
Purchasing.Vendor
(104 rows)
Companies from whom Adventure Works Cycles purchases parts or other goods. |
Person.EmailAddress
(19,972 rows)
Where to send a person email. |
Sales.CountryRegionCurrency
(109 rows)
Cross-reference table mapping ISO currency codes to a country or region. |
Person.Password
(19,972 rows)
One way hashed authentication information |
Sales.CreditCard
(19,118 rows)
Customer credit card information. |
Person.Person
(19,972 rows)
Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts. |
Sales.Currency
(105 rows)
Lookup table containing standard ISO currencies. |
Person.PersonPhone
(19,972 rows)
Telephone number and type of a person. |
Sales.CurrencyRate
(13,532 rows)
Currency exchange rates. |
Person.PhoneNumberType
(3 rows)
Type of phone number of a person. |
Sales.Customer
(19,820 rows)
Current customer information. Also see the Person and Store tables. |
Person.StateProvince
(181 rows)
State and province lookup table. |
Sales.PersonCreditCard
(19,118 rows)
Cross-reference table mapping people to their credit card information in the CreditCard table. |
Production.BillOfMaterials
(2,679 rows)
Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components. |
Sales.SalesOrderDetail
(121,317 rows)
Individual products associated with a specific sales order. See SalesOrderHeader. |
Production.Culture
(8 rows)
Lookup table containing the languages in which some AdventureWorks data is stored. |
Sales.SalesOrderHeader
(31,465 rows)
General sales order information. |
Production.Document
(13 rows)
Product maintenance documents. |
Sales.SalesOrderHeaderSalesReason
(27,647 rows)
Cross-reference table mapping sales orders to sales reason codes. |
Production.Illustration
(5 rows)
Bicycle assembly diagrams. |
Sales.SalesPerson
(17 rows)
Sales representative current information. |
Production.Location
(14 rows)
Product inventory and manufacturing locations. |
Sales.SalesPersonQuotaHistory
(163 rows)
Sales performance tracking. |
Production.Product
(504 rows)
Products sold or used in the manfacturing of sold products. |
Sales.SalesReason
(10 rows)
Lookup table of customer purchase reasons. |
Production.ProductCategory
(4 rows)
High-level product categorization. |
Sales.SalesTaxRate
(29 rows)
Tax rate lookup table. |
Production.ProductCostHistory
(395 rows)
Changes in the cost of a product over time. |
Sales.SalesTerritory
(10 rows)
Sales territory lookup table. |
Production.ProductDescription
(762 rows)
Product descriptions in several languages. |
Sales.SalesTerritoryHistory
(17 rows)
Sales representative transfers to other sales territories. |
Production.ProductDocument
(32 rows)
Cross-reference table mapping products to related product documents. |
Sales.ShoppingCartItem
(3 rows)
Contains online customer orders until the order is submitted or cancelled. |
Production.ProductInventory
(1,069 rows)
Product inventory information. |
Sales.SpecialOffer
(16 rows)
Sale discounts lookup table. |
Production.ProductListPriceHistory
(395 rows)
Changes in the list price of a product over time. |
Sales.SpecialOfferProduct
(538 rows)
Cross-reference table mapping products to special offer discounts. |
Production.ProductModel
(128 rows)
Product model classification. |
Sales.Store
(701 rows)
Customers (resellers) of Adventure Works products. |
Production.ProductModelIllustration
(7 rows)
Cross-reference table mapping product models and illustrations. |
HumanResources.vEmployee Employee names and addresses. |
Production.vProductModelInstructions Displays the content from each element in the xml column Instructions for each product in the Production.ProductModel table that has manufacturing instructions. |
HumanResources.vEmployeeDepartment Returns employee name, title, and current department. |
Purchasing.vVendorWithAddresses Vendor (company) names and addresses . |
HumanResources.vEmployeeDepartmentHistory Returns employee name and current and previous departments. |
Purchasing.vVendorWithContacts Vendor (company) names and the names of vendor employees to contact. |
HumanResources.vJobCandidate Job candidate names and resumes. |
Sales.vIndividualCustomer Individual customers (names and addresses) that purchase Adventure Works Cycles products online. |
HumanResources.vJobCandidateEducation Displays the content from each education related element in the xml column Resume in the HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai. Some data may not display correctly unless supplemental language support is installed. |
Sales.vPersonDemographics Displays the content from each element in the xml column Demographics for each customer in the Person.Person table. |
HumanResources.vJobCandidateEmployment Displays the content from each employement history related element in the xml column Resume in the HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai. Some data may not display correctly unless supplemental language support is installed. |
Sales.vSalesPerson Sales representiatives (names and addresses) and their sales-related information. |
Person.vAdditionalContactInfo Displays the contact name and content from each element in the xml column AdditionalContactInfo for that person. |
Sales.vSalesPersonSalesByFiscalYears Uses PIVOT to return aggregated sales information for each sales representative. |
Person.vStateProvinceCountryRegion Joins StateProvince table with CountryRegion table. |
Sales.vStoreWithAddresses Stores (including store addresses) that sell Adventure Works Cycles products to consumers. |
Production.vProductAndDescription Product names and descriptions. Product descriptions are provided in multiple languages. |
Sales.vStoreWithContacts Stores (including store contacts) that sell Adventure Works Cycles products to consumers. |
Production.vProductModelCatalogDescription Displays the content from each element in the xml column CatalogDescription for each product in the Production.ProductModel table that has catalog data. |
Sales.vStoreWithDemographics Stores (including demographics) that sell Adventure Works Cycles products to consumers. |
dbo.uspGetBillOfMaterials Stored procedure using a recursive query to return a multi-level bill of material for the specified ProductID. |
dbo.uspPrintError Prints error information about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without printing any error information. |
dbo.uspGetEmployeeManagers Stored procedure using a recursive query to return the direct and indirect managers of the specified employee. |
dbo.uspSearchCandidateResumes |
dbo.uspGetManagerEmployees Stored procedure using a recursive query to return the direct and indirect employees of the specified manager. |
HumanResources.uspUpdateEmployeeHireInfo Updates the Employee table and inserts a new row in the EmployeePayHistory table with the values specified in the input parameters. |
dbo.uspGetWhereUsedProductID Stored procedure using a recursive query to return all components or assemblies that directly or indirectly use the specified ProductID. |
HumanResources.uspUpdateEmployeeLogin Updates the Employee table with the values specified in the input parameters for the given BusinessEntityID. |
dbo.uspLogError Logs error information in the ErrorLog table about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without inserting error information. |
HumanResources.uspUpdateEmployeePersonalInfo Updates the Employee table with the values specified in the input parameters for the given EmployeeID. |
dbo.ufnGetAccountingEndDate Scalar function used in the uSalesOrderHeader trigger to set the starting account date. |
dbo.ufnGetProductStandardCost Scalar function returning the standard cost for a given product on a particular order date. |
dbo.ufnGetAccountingStartDate Scalar function used in the uSalesOrderHeader trigger to set the ending account date. |
dbo.ufnGetPurchaseOrderStatusText Scalar function returning the text representation of the Status column in the PurchaseOrderHeader table. |
dbo.ufnGetContactInformation Table value function returning the first name, last name, job title and contact type for a given contact. |
dbo.ufnGetSalesOrderStatusText Scalar function returning the text representation of the Status column in the SalesOrderHeader table. |
dbo.ufnGetDocumentStatusText Scalar function returning the text representation of the Status column in the Document table. |
dbo.ufnGetStock Scalar function returning the quantity of inventory in LocationID 6 (Miscellaneous Storage)for a specified ProductID. |
dbo.ufnGetProductDealerPrice Scalar function returning the dealer price for a given product on a particular order date. |
dbo.ufnLeadingZeros Scalar function used by the Sales.Customer table to help set the account number. |
dbo.ufnGetProductListPrice Scalar function returning the list price for a given product on a particular order date. |
Current version number of the AdventureWorks 2014 sample database.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | SystemInformationID | tinyint | X | ||
Primary key for AWBuildVersion records. | |||||
Database Version | nvarchar(25) | ||||
Version number of the database in 9.yy.mm.dd.00 format. | |||||
VersionDate | datetime | ||||
Date and time the record was last updated. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | DatabaseLogID | int | X | ||
Primary key for DatabaseLog records. | |||||
PostTime | datetime | ||||
The date and time the DDL change occurred. | |||||
DatabaseUser | sysname(nvarchar(128)) | ||||
The user who implemented the DDL change. | |||||
Event | sysname(nvarchar(128)) | ||||
The type of DDL statement that was executed. | |||||
Schema | sysname(nvarchar(128)) | X | |||
The schema to which the changed object belongs. | |||||
Object | sysname(nvarchar(128)) | X | |||
The object that was changed by the DDL statment. | |||||
TSQL | nvarchar(max) | ||||
The exact Transact-SQL statement that was executed. | |||||
XmlEvent | xml | ||||
The raw XML data generated by database trigger. |
Primary key (nonclustered) constraint
Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ErrorLogID | int | X | ||
Primary key for ErrorLog records. | |||||
ErrorTime | datetime | getdate() | |||
The date and time at which the error occurred. | |||||
UserName | sysname(nvarchar(128)) | ||||
The user who executed the batch in which the error occurred. | |||||
ErrorNumber | int | ||||
The error number of the error that occurred. | |||||
ErrorSeverity | int | X | |||
The severity of the error that occurred. | |||||
ErrorState | int | X | |||
The state number of the error that occurred. | |||||
ErrorProcedure | nvarchar(126) | X | |||
The name of the stored procedure or trigger where the error occurred. | |||||
ErrorLine | int | X | |||
The line number at which the error occurred. | |||||
ErrorMessage | nvarchar(4000) | ||||
The message text of the error that occurred. |
Primary key (clustered) constraint
Lookup table containing the departments within the Adventure Works Cycles company.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | DepartmentID | smallint | X | ||
Primary key for Department records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Name of the department. | |||||
GroupName | Name(nvarchar(50)) | ||||
Name of the group to which the department belongs. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Employee information such as salary, department, and title.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID. | |||||
UK | NationalIDNumber | nvarchar(15) | |||
Unique national identification number such as a social security number. | |||||
UK | LoginID | nvarchar(256) | |||
Network login. | |||||
OrganizationNode | hierarchyid | X | |||
Where the employee is located in corporate hierarchy. | |||||
OrganizationLevel | smallint | X | |||
The depth of the employee in the corporate hierarchy. | |||||
JobTitle | nvarchar(50) | ||||
Work title such as Buyer or Sales Representative. | |||||
BirthDate | date | ||||
Date of birth. | |||||
MaritalStatus | nchar(1) | ||||
M = Married, S = Single | |||||
Gender | nchar(1) | ||||
M = Male, F = Female | |||||
HireDate | date | ||||
Employee hired on this date. | |||||
SalariedFlag | Flag(bit) | 1 | |||
Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. | |||||
VacationHours | smallint | 0 | |||
Number of available vacation hours. | |||||
SickLeaveHours | smallint | 0 | |||
Number of available sick leave hours. | |||||
CurrentFlag | Flag(bit) | 1 | |||
0 = Inactive, 1 = Active | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Unique nonclustered index.
Unique nonclustered index.
INSTEAD OF DELETE trigger which keeps Employees from being deleted.
Employee department transfers.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Employee identification number. Foreign key to Employee.BusinessEntityID. | |||||
PK, FK | DepartmentID | smallint | |||
Department in which the employee worked including currently. Foreign key to Department.DepartmentID. | |||||
PK, FK | ShiftID | tinyint | |||
Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. | |||||
PK | StartDate | date | |||
Date the employee started work in the department. | |||||
EndDate | date | X | |||
Date the employee left the department. NULL = Current department. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Nonclustered index.
Employee pay history.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Employee identification number. Foreign key to Employee.BusinessEntityID. | |||||
PK | RateChangeDate | datetime | |||
Date the change in pay is effective | |||||
Rate | money | ||||
Salary hourly rate. | |||||
PayFrequency | tinyint | ||||
1 = Salary received monthly, 2 = Salary received biweekly | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Résumés submitted to Human Resources by job applicants.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | JobCandidateID | int | X | ||
Primary key for JobCandidate records. | |||||
FK | BusinessEntityID | int | X | ||
Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID. | |||||
Resume | xml | X | |||
Résumé in XML format. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Work shift lookup table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ShiftID | tinyint | X | ||
Primary key for Shift records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Shift description. | |||||
UK | StartTime | time | |||
Shift start time. | |||||
UK | EndTime | time | |||
Shift end time. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index.
Street address information for customers, employees, and vendors.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | AddressID | int | X | ||
Primary key for Address records. | |||||
UK | AddressLine1 | nvarchar(60) | |||
First street address line. | |||||
UK | AddressLine2 | nvarchar(60) | X | ||
Second street address line. | |||||
UK | City | nvarchar(30) | |||
Name of the city. | |||||
UK, FK | StateProvinceID | int | |||
Unique identification number for the state or province. Foreign key to StateProvince table. | |||||
UK | PostalCode | nvarchar(15) | |||
Postal code for the street address. | |||||
SpatialLocation | geography | X | |||
Latitude and longitude of this address. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Nonclustered index.
Nonclustered index.
Types of addresses stored in the Address table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | AddressTypeID | int | X | ||
Primary key for AddressType records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Address type description. For example, Billing, Home, or Shipping. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Source of the ID that connects vendors, customers, and employees with address and contact information.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | BusinessEntityID | int | X | ||
Primary key for all customers, vendors, and employees. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Cross-reference table mapping customers, vendors, and employees to their addresses.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key. Foreign key to BusinessEntity.BusinessEntityID. | |||||
PK, FK | AddressID | int | |||
Primary key. Foreign key to Address.AddressID. | |||||
PK, FK | AddressTypeID | int | |||
Primary key. Foreign key to AddressType.AddressTypeID. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Nonclustered index.
Nonclustered index.
Cross-reference table mapping stores, vendors, and employees to people
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key. Foreign key to BusinessEntity.BusinessEntityID. | |||||
PK, FK | PersonID | int | |||
Primary key. Foreign key to Person.BusinessEntityID. | |||||
PK, FK | ContactTypeID | int | |||
Primary key. Foreign key to ContactType.ContactTypeID. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Nonclustered index.
Nonclustered index.
Lookup table containing the types of business entity contacts.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ContactTypeID | int | X | ||
Primary key for ContactType records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Contact type description. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Lookup table containing the ISO standard codes for countries and regions.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | CountryRegionCode | nvarchar(3) | |||
ISO standard code for countries and regions. | |||||
UK | Name | Name(nvarchar(50)) | |||
Country or region name. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Where to send a person email.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID | |||||
PK | EmailAddressID | int | X | ||
Primary key. ID of this email address. | |||||
EmailAddress | nvarchar(50) | X | |||
E-mail address for the person. | |||||
rowguid | uniqueidentifier | newid() | |||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
One way hashed authentication information
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
PasswordHash | varchar(128) | ||||
Password for the e-mail account. | |||||
PasswordSalt | varchar(10) | ||||
Random value concatenated with the password string before the password is hashed. | |||||
rowguid | uniqueidentifier | newid() | |||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key for Person records. | |||||
PersonType | nchar(2) | ||||
Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact | |||||
NameStyle | NameStyle(bit) | 0 | |||
0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. | |||||
Title | nvarchar(8) | X | |||
A courtesy title. For example, Mr. or Ms. | |||||
FirstName | Name(nvarchar(50)) | ||||
First name of the person. | |||||
MiddleName | Name(nvarchar(50)) | X | |||
Middle name or middle initial of the person. | |||||
LastName | Name(nvarchar(50)) | ||||
Last name of the person. | |||||
Suffix | nvarchar(10) | X | |||
Surname suffix. For example, Sr. or Jr. | |||||
EmailPromotion | int | 0 | |||
0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. | |||||
AdditionalContactInfo | xml | X | |||
Additional contact information about the person stored in xml format. | |||||
Demographics | xml | X | |||
Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Primary XML index.
Primary XML index.
Secondary XML index for path.
Secondary XML index for property.
Secondary XML index for value.
AFTER INSERT, UPDATE trigger inserting Individual only if the Customer does not exist in the Store table and setting the ModifiedDate column in the Person table to the current date.
Telephone number and type of a person.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Business entity identification number. Foreign key to Person.BusinessEntityID. | |||||
PK | PhoneNumber | Phone(nvarchar(25)) | |||
Telephone number identification number. | |||||
PK, FK | PhoneNumberTypeID | int | |||
Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Type of phone number of a person.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | PhoneNumberTypeID | int | X | ||
Primary key for telephone number type records. | |||||
Name | Name(nvarchar(50)) | ||||
Name of the telephone number type | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
State and province lookup table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | StateProvinceID | int | X | ||
Primary key for StateProvince records. | |||||
UK | StateProvinceCode | nchar(3) | |||
ISO standard state or province code. | |||||
UK, FK | CountryRegionCode | nvarchar(3) | |||
ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. | |||||
IsOnlyStateProvinceFlag | Flag(bit) | 1 | |||
0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. | |||||
UK | Name | Name(nvarchar(50)) | |||
State or province description. | |||||
FK | TerritoryID | int | |||
ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Unique nonclustered index.
Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | BillOfMaterialsID | int | X | ||
Primary key for BillOfMaterials records. | |||||
UK, FK | ProductAssemblyID | int | X | ||
Parent product identification number. Foreign key to Product.ProductID. | |||||
UK, FK | ComponentID | int | |||
Component identification number. Foreign key to Product.ProductID. | |||||
UK | StartDate | datetime | getdate() | ||
Date the component started being used in the assembly item. | |||||
EndDate | datetime | X | |||
Date the component stopped being used in the assembly item. | |||||
FK | UnitMeasureCode | nchar(3) | |||
Standard code identifying the unit of measure for the quantity. | |||||
BOMLevel | smallint | ||||
Indicates the depth the component is from its parent (AssemblyID). | |||||
PerAssemblyQty | decimal(8,2) | 1.00 | |||
Quantity of the component needed to create the assembly. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Clustered index.
Nonclustered index.
Lookup table containing the languages in which some AdventureWorks data is stored.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | CultureID | nchar(6) | |||
Primary key for Culture records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Culture description. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Product maintenance documents.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, UK | DocumentNode | hierarchyid | |||
Primary key for Document records. | |||||
UK | DocumentLevel | smallint | X | ||
Depth in the document hierarchy. | |||||
Title | nvarchar(50) | ||||
Title of the document. | |||||
FK | Owner | int | |||
Employee who controls the document. Foreign key to Employee.BusinessEntityID | |||||
FolderFlag | bit | 0 | |||
0 = This is a folder, 1 = This is a document. | |||||
FileName | nvarchar(400) | ||||
File name of the document | |||||
FileExtension | nvarchar(8) | ||||
File extension indicating the document type. For example, .doc or .txt. | |||||
Revision | nchar(5) | ||||
Revision number of the document. | |||||
ChangeNumber | int | 0 | |||
Engineering change approval number. | |||||
Status | tinyint | ||||
1 = Pending approval, 2 = Approved, 3 = Obsolete | |||||
DocumentSummary | nvarchar(max) | X | |||
Document abstract. | |||||
Document | varbinary(max) | X | |||
Complete document. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Required for FileStream. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support FileStream.
Unique nonclustered index.
Bicycle assembly diagrams.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | IllustrationID | int | X | ||
Primary key for Illustration records. | |||||
Diagram | xml | X | |||
Illustrations used in manufacturing instructions. Stored as XML. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Product inventory and manufacturing locations.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | LocationID | smallint | X | ||
Primary key for Location records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Location description. | |||||
CostRate | smallmoney | 0.00 | |||
Standard hourly cost of the manufacturing location. | |||||
Availability | decimal(8,2) | 0.00 | |||
Work capacity (in hours) of the manufacturing location. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Products sold or used in the manfacturing of sold products.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ProductID | int | X | ||
Primary key for Product records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Name of the product. | |||||
UK | ProductNumber | nvarchar(25) | |||
Unique product identification number. | |||||
MakeFlag | Flag(bit) | 1 | |||
0 = Product is purchased, 1 = Product is manufactured in-house. | |||||
FinishedGoodsFlag | Flag(bit) | 1 | |||
0 = Product is not a salable item. 1 = Product is salable. | |||||
Color | nvarchar(15) | X | |||
Product color. | |||||
SafetyStockLevel | smallint | ||||
Minimum inventory quantity. | |||||
ReorderPoint | smallint | ||||
Inventory level that triggers a purchase order or work order. | |||||
StandardCost | money | ||||
Standard cost of the product. | |||||
ListPrice | money | ||||
Selling price. | |||||
Size | nvarchar(5) | X | |||
Product size. | |||||
FK | SizeUnitMeasureCode | nchar(3) | X | ||
Unit of measure for Size column. | |||||
FK | WeightUnitMeasureCode | nchar(3) | X | ||
Unit of measure for Weight column. | |||||
Weight | decimal(8,2) | X | |||
Product weight. | |||||
DaysToManufacture | int | ||||
Number of days required to manufacture the product. | |||||
ProductLine | nchar(2) | X | |||
R = Road, M = Mountain, T = Touring, S = Standard | |||||
Class | nchar(2) | X | |||
H = High, M = Medium, L = Low | |||||
Style | nchar(2) | X | |||
W = Womens, M = Mens, U = Universal | |||||
FK | ProductSubcategoryID | int | X | ||
Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID. | |||||
FK | ProductModelID | int | X | ||
Product is a member of this product model. Foreign key to ProductModel.ProductModelID. | |||||
SellStartDate | datetime | ||||
Date the product was available for sale. | |||||
SellEndDate | datetime | X | |||
Date the product was no longer available for sale. | |||||
DiscontinuedDate | datetime | X | |||
Date the product was discontinued. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
High-level product categorization.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ProductCategoryID | int | X | ||
Primary key for ProductCategory records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Category description. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Changes in the cost of a product over time.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID | |||||
PK | StartDate | datetime | |||
Product cost start date. | |||||
EndDate | datetime | X | |||
Product cost end date. | |||||
StandardCost | money | ||||
Standard cost of the product. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Product descriptions in several languages.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ProductDescriptionID | int | X | ||
Primary key for ProductDescription records. | |||||
Description | nvarchar(400) | ||||
Description of the product. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Cross-reference table mapping products to related product documents.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID. | |||||
PK, FK | DocumentNode | hierarchyid | |||
Document identification number. Foreign key to Document.DocumentNode. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Product inventory information.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID. | |||||
PK, FK | LocationID | smallint | |||
Inventory location identification number. Foreign key to Location.LocationID. | |||||
Shelf | nvarchar(10) | ||||
Storage compartment within an inventory location. | |||||
Bin | tinyint | ||||
Storage container on a shelf in an inventory location. | |||||
Quantity | smallint | 0 | |||
Quantity of products in the inventory location. | |||||
rowguid | uniqueidentifier | newid() | |||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Changes in the list price of a product over time.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID | |||||
PK | StartDate | datetime | |||
List price start date. | |||||
EndDate | datetime | X | |||
List price end date | |||||
ListPrice | money | ||||
Product list price. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Product model classification.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ProductModelID | int | X | ||
Primary key for ProductModel records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Product model description. | |||||
CatalogDescription | xml | X | |||
Detailed product catalog information in xml format. | |||||
Instructions | xml | X | |||
Manufacturing instructions in xml format. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Primary XML index.
Primary XML index.
Cross-reference table mapping product models and illustrations.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | ProductModelID | int | |||
Primary key. Foreign key to ProductModel.ProductModelID. | |||||
PK, FK | IllustrationID | int | |||
Primary key. Foreign key to Illustration.IllustrationID. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Cross-reference table mapping product descriptions and the language the description is written in.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | ProductModelID | int | |||
Primary key. Foreign key to ProductModel.ProductModelID. | |||||
PK, FK | ProductDescriptionID | int | |||
Primary key. Foreign key to ProductDescription.ProductDescriptionID. | |||||
PK, FK | CultureID | nchar(6) | |||
Culture identification number. Foreign key to Culture.CultureID. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Product images.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ProductPhotoID | int | X | ||
Primary key for ProductPhoto records. | |||||
ThumbNailPhoto | varbinary(max) | X | |||
Small image of the product. | |||||
ThumbnailPhotoFileName | nvarchar(50) | X | |||
Small image file name. | |||||
LargePhoto | varbinary(max) | X | |||
Large image of the product. | |||||
LargePhotoFileName | nvarchar(50) | X | |||
Large image file name. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Cross-reference table mapping products and product photos.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID. | |||||
PK, FK | ProductPhotoID | int | |||
Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. | |||||
Primary | Flag(bit) | 0 | |||
0 = Photo is not the principal image. 1 = Photo is the principal image. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Customer reviews of products they have purchased.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ProductReviewID | int | X | ||
Primary key for ProductReview records. | |||||
FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID. | |||||
ReviewerName | Name(nvarchar(50)) | ||||
Name of the reviewer. | |||||
ReviewDate | datetime | getdate() | |||
Date review was submitted. | |||||
EmailAddress | nvarchar(50) | ||||
Reviewer's e-mail address. | |||||
Rating | int | ||||
Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. | |||||
Comments | nvarchar(3850) | X | |||
Reviewer's comments | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Product subcategories. See ProductCategory table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ProductSubcategoryID | int | X | ||
Primary key for ProductSubcategory records. | |||||
FK | ProductCategoryID | int | |||
Product category identification number. Foreign key to ProductCategory.ProductCategoryID. | |||||
UK | Name | Name(nvarchar(50)) | |||
Subcategory description. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Manufacturing failure reasons lookup table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ScrapReasonID | smallint | X | ||
Primary key for ScrapReason records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Failure description. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Record of each purchase order, sales order, or work order transaction year to date.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | TransactionID | int | X | ||
Primary key for TransactionHistory records. | |||||
FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID. | |||||
ReferenceOrderID | int | ||||
Purchase order, sales order, or work order identification number. | |||||
ReferenceOrderLineID | int | 0 | |||
Line number associated with the purchase order, sales order, or work order. | |||||
TransactionDate | datetime | getdate() | |||
Date and time of the transaction. | |||||
TransactionType | nchar(1) | ||||
W = WorkOrder, S = SalesOrder, P = PurchaseOrder | |||||
Quantity | int | ||||
Product quantity. | |||||
ActualCost | money | ||||
Product cost. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Nonclustered index.
Transactions for previous years.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | TransactionID | int | |||
Primary key for TransactionHistoryArchive records. | |||||
ProductID | int | ||||
Product identification number. Foreign key to Product.ProductID. | |||||
ReferenceOrderID | int | ||||
Purchase order, sales order, or work order identification number. | |||||
ReferenceOrderLineID | int | 0 | |||
Line number associated with the purchase order, sales order, or work order. | |||||
TransactionDate | datetime | getdate() | |||
Date and time of the transaction. | |||||
TransactionType | nchar(1) | ||||
W = Work Order, S = Sales Order, P = Purchase Order | |||||
Quantity | int | ||||
Product quantity. | |||||
ActualCost | money | ||||
Product cost. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Nonclustered index.
Unit of measure lookup table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | UnitMeasureCode | nchar(3) | |||
Primary key. | |||||
UK | Name | Name(nvarchar(50)) | |||
Unit of measure description. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Manufacturing work orders.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | WorkOrderID | int | X | ||
Primary key for WorkOrder records. | |||||
FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID. | |||||
OrderQty | int | ||||
Product quantity to build. | |||||
StockedQty | int | ||||
Quantity built and put in inventory. | |||||
ScrappedQty | smallint | ||||
Quantity that failed inspection. | |||||
StartDate | datetime | ||||
Work order start date. | |||||
EndDate | datetime | X | |||
Work order end date. | |||||
DueDate | datetime | ||||
Work order due date. | |||||
FK | ScrapReasonID | smallint | X | ||
Reason for inspection failure. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Nonclustered index.
AFTER INSERT trigger that inserts a row in the TransactionHistory table.
AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in the WorkOrder table.
Work order details.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | WorkOrderID | int | |||
Primary key. Foreign key to WorkOrder.WorkOrderID. | |||||
PK | ProductID | int | |||
Primary key. Foreign key to Product.ProductID. | |||||
PK | OperationSequence | smallint | |||
Primary key. Indicates the manufacturing process sequence. | |||||
FK | LocationID | smallint | |||
Manufacturing location where the part is processed. Foreign key to Location.LocationID. | |||||
ScheduledStartDate | datetime | ||||
Planned manufacturing start date. | |||||
ScheduledEndDate | datetime | ||||
Planned manufacturing end date. | |||||
ActualStartDate | datetime | X | |||
Actual start date. | |||||
ActualEndDate | datetime | X | |||
Actual end date. | |||||
ActualResourceHrs | decimal(9,4) | X | |||
Number of manufacturing hours used. | |||||
PlannedCost | money | ||||
Estimated manufacturing cost. | |||||
ActualCost | money | X | |||
Actual manufacturing cost. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Cross-reference table mapping vendors with the products they supply.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | ProductID | int | |||
Primary key. Foreign key to Product.ProductID. | |||||
PK, FK | BusinessEntityID | int | |||
Primary key. Foreign key to Vendor.BusinessEntityID. | |||||
AverageLeadTime | int | ||||
The average span of time (in days) between placing an order with the vendor and receiving the purchased product. | |||||
StandardPrice | money | ||||
The vendor's usual selling price. | |||||
LastReceiptCost | money | X | |||
The selling price when last purchased. | |||||
LastReceiptDate | datetime | X | |||
Date the product was last received by the vendor. | |||||
MinOrderQty | int | ||||
The maximum quantity that should be ordered. | |||||
MaxOrderQty | int | ||||
The minimum quantity that should be ordered. | |||||
OnOrderQty | int | X | |||
The quantity currently on order. | |||||
FK | UnitMeasureCode | nchar(3) | |||
The product's unit of measure. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Nonclustered index.
Individual products associated with a specific purchase order. See PurchaseOrderHeader.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | PurchaseOrderID | int | |||
Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. | |||||
PK | PurchaseOrderDetailID | int | X | ||
Primary key. One line number per purchased product. | |||||
DueDate | datetime | ||||
Date the product is expected to be received. | |||||
OrderQty | smallint | ||||
Quantity ordered. | |||||
FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID. | |||||
UnitPrice | money | ||||
Vendor's selling price of a single product. | |||||
LineTotal | money | ||||
Per product subtotal. Computed as OrderQty * UnitPrice. | |||||
ReceivedQty | decimal(8,2) | ||||
Quantity actually received from the vendor. | |||||
RejectedQty | decimal(8,2) | ||||
Quantity rejected during inspection. | |||||
StockedQty | decimal(9,2) | ||||
Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
AFTER INSERT trigger that inserts a row in the TransactionHistory table and updates the PurchaseOrderHeader.SubTotal column.
AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in PurchaseOrderDetail and updates the PurchaseOrderHeader.SubTotal column.
General purchase order information. See PurchaseOrderDetail.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | PurchaseOrderID | int | X | ||
Primary key. | |||||
RevisionNumber | tinyint | 0 | |||
Incremental number to track changes to the purchase order over time. | |||||
Status | tinyint | 1 | |||
Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete | |||||
FK | EmployeeID | int | |||
Employee who created the purchase order. Foreign key to Employee.BusinessEntityID. | |||||
FK | VendorID | int | |||
Vendor with whom the purchase order is placed. Foreign key to Vendor.BusinessEntityID. | |||||
FK | ShipMethodID | int | |||
Shipping method. Foreign key to ShipMethod.ShipMethodID. | |||||
OrderDate | datetime | getdate() | |||
Purchase order creation date. | |||||
ShipDate | datetime | X | |||
Estimated shipment date from the vendor. | |||||
SubTotal | money | 0.00 | |||
Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. | |||||
TaxAmt | money | 0.00 | |||
Tax amount. | |||||
Freight | money | 0.00 | |||
Shipping cost. | |||||
TotalDue | money | ||||
Total due to vendor. Computed as Subtotal + TaxAmt + Freight. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Nonclustered index.
AFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the PurchaseOrderHeader table.
Shipping company lookup table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ShipMethodID | int | X | ||
Primary key for ShipMethod records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Shipping company name. | |||||
ShipBase | money | 0.00 | |||
Minimum shipping charge. | |||||
ShipRate | money | 0.00 | |||
Shipping charge per pound. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Companies from whom Adventure Works Cycles purchases parts or other goods.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityID | |||||
UK | AccountNumber | AccountNumber(nvarchar(15)) | |||
Vendor account (identification) number. | |||||
Name | Name(nvarchar(50)) | ||||
Company name. | |||||
CreditRating | tinyint | ||||
1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average | |||||
PreferredVendorStatus | Flag(bit) | 1 | |||
0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. | |||||
ActiveFlag | Flag(bit) | 1 | |||
0 = Vendor no longer used. 1 = Vendor is actively used. | |||||
PurchasingWebServiceURL | nvarchar(1024) | X | |||
Vendor URL. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
INSTEAD OF DELETE trigger which keeps Vendors from being deleted.
Cross-reference table mapping ISO currency codes to a country or region.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | CountryRegionCode | nvarchar(3) | |||
ISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode. | |||||
PK, FK | CurrencyCode | nchar(3) | |||
ISO standard currency code. Foreign key to Currency.CurrencyCode. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Customer credit card information.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | CreditCardID | int | X | ||
Primary key for CreditCard records. | |||||
CardType | nvarchar(50) | ||||
Credit card name. | |||||
UK | CardNumber | nvarchar(25) | |||
Credit card number. | |||||
ExpMonth | tinyint | ||||
Credit card expiration month. | |||||
ExpYear | smallint | ||||
Credit card expiration year. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Lookup table containing standard ISO currencies.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | CurrencyCode | nchar(3) | |||
The ISO code for the Currency. | |||||
UK | Name | Name(nvarchar(50)) | |||
Currency name. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Currency exchange rates.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | CurrencyRateID | int | X | ||
Primary key for CurrencyRate records. | |||||
UK | CurrencyRateDate | datetime | |||
Date and time the exchange rate was obtained. | |||||
UK, FK | FromCurrencyCode | nchar(3) | |||
Exchange rate was converted from this currency code. | |||||
UK, FK | ToCurrencyCode | nchar(3) | |||
Exchange rate was converted to this currency code. | |||||
AverageRate | money | ||||
Average exchange rate for the day. | |||||
EndOfDayRate | money | ||||
Final exchange rate for the day. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Current customer information. Also see the Person and Store tables.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | CustomerID | int | X | ||
Primary key. | |||||
FK | PersonID | int | X | ||
Foreign key to Person.BusinessEntityID | |||||
FK | StoreID | int | X | ||
Foreign key to Store.BusinessEntityID | |||||
FK | TerritoryID | int | X | ||
ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. | |||||
UK | AccountNumber | varchar(10) | |||
Unique number identifying the customer assigned by the accounting system. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Nonclustered index.
Cross-reference table mapping people to their credit card information in the CreditCard table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Business entity identification number. Foreign key to Person.BusinessEntityID. | |||||
PK, FK | CreditCardID | int | |||
Credit card identification number. Foreign key to CreditCard.CreditCardID. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Individual products associated with a specific sales order. See SalesOrderHeader.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | SalesOrderID | int | |||
Primary key. Foreign key to SalesOrderHeader.SalesOrderID. | |||||
PK | SalesOrderDetailID | int | X | ||
Primary key. One incremental unique number per product sold. | |||||
CarrierTrackingNumber | nvarchar(25) | X | |||
Shipment tracking number supplied by the shipper. | |||||
OrderQty | smallint | ||||
Quantity ordered per product. | |||||
FK | ProductID | int | |||
Product sold to customer. Foreign key to Product.ProductID. | |||||
FK | SpecialOfferID | int | |||
Promotional code. Foreign key to SpecialOffer.SpecialOfferID. | |||||
UnitPrice | money | ||||
Selling price of a single product. | |||||
UnitPriceDiscount | money | 0.0 | |||
Discount amount. | |||||
LineTotal | numeric(38,6) | ||||
Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Nonclustered index.
AFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.
General sales order information.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | SalesOrderID | int | X | ||
Primary key. | |||||
RevisionNumber | tinyint | 0 | |||
Incremental number to track changes to the sales order over time. | |||||
OrderDate | datetime | getdate() | |||
Dates the sales order was created. | |||||
DueDate | datetime | ||||
Date the order is due to the customer. | |||||
ShipDate | datetime | X | |||
Date the order was shipped to the customer. | |||||
Status | tinyint | 1 | |||
Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled | |||||
OnlineOrderFlag | Flag(bit) | 1 | |||
0 = Order placed by sales person. 1 = Order placed online by customer. | |||||
UK | SalesOrderNumber | nvarchar(25) | |||
Unique sales order identification number. | |||||
PurchaseOrderNumber | OrderNumber(nvarchar(25)) | X | |||
Customer purchase order number reference. | |||||
AccountNumber | AccountNumber(nvarchar(15)) | X | |||
Financial accounting number reference. | |||||
FK | CustomerID | int | |||
Customer identification number. Foreign key to Customer.BusinessEntityID. | |||||
FK | SalesPersonID | int | X | ||
Sales person who created the sales order. Foreign key to SalesPerson.BusinessEntityID. | |||||
FK | TerritoryID | int | X | ||
Territory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID. | |||||
FK | BillToAddressID | int | |||
Customer billing address. Foreign key to Address.AddressID. | |||||
FK | ShipToAddressID | int | |||
Customer shipping address. Foreign key to Address.AddressID. | |||||
FK | ShipMethodID | int | |||
Shipping method. Foreign key to ShipMethod.ShipMethodID. | |||||
FK | CreditCardID | int | X | ||
Credit card identification number. Foreign key to CreditCard.CreditCardID. | |||||
CreditCardApprovalCode | varchar(15) | X | |||
Approval code provided by the credit card company. | |||||
FK | CurrencyRateID | int | X | ||
Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID. | |||||
SubTotal | money | 0.00 | |||
Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. | |||||
TaxAmt | money | 0.00 | |||
Tax amount. | |||||
Freight | money | 0.00 | |||
Shipping cost. | |||||
TotalDue | money | ||||
Total due from customer. Computed as Subtotal + TaxAmt + Freight. | |||||
Comment | nvarchar(128) | X | |||
Sales representative comments. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Unique nonclustered index.
Nonclustered index.
Nonclustered index.
AFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables.
Cross-reference table mapping sales orders to sales reason codes.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | SalesOrderID | int | |||
Primary key. Foreign key to SalesOrderHeader.SalesOrderID. | |||||
PK, FK | SalesReasonID | int | |||
Primary key. Foreign key to SalesReason.SalesReasonID. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Sales representative current information.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key for SalesPerson records. Foreign key to Employee.BusinessEntityID | |||||
FK | TerritoryID | int | X | ||
Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. | |||||
SalesQuota | money | X | |||
Projected yearly sales. | |||||
Bonus | money | 0.00 | |||
Bonus due if quota is met. | |||||
CommissionPct | smallmoney | 0.00 | |||
Commision percent received per sale. | |||||
SalesYTD | money | 0.00 | |||
Sales total year to date. | |||||
SalesLastYear | money | 0.00 | |||
Sales total of previous year. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Sales performance tracking.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Sales person identification number. Foreign key to SalesPerson.BusinessEntityID. | |||||
PK | QuotaDate | datetime | |||
Sales quota date. | |||||
SalesQuota | money | ||||
Sales quota amount. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Lookup table of customer purchase reasons.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | SalesReasonID | int | X | ||
Primary key for SalesReason records. | |||||
Name | Name(nvarchar(50)) | ||||
Sales reason description. | |||||
ReasonType | Name(nvarchar(50)) | ||||
Category the sales reason belongs to. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Tax rate lookup table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | SalesTaxRateID | int | X | ||
Primary key for SalesTaxRate records. | |||||
UK, FK | StateProvinceID | int | |||
State, province, or country/region the sales tax applies to. | |||||
UK | TaxType | tinyint | |||
1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. | |||||
TaxRate | smallmoney | 0.00 | |||
Tax rate amount. | |||||
Name | Name(nvarchar(50)) | ||||
Tax rate description. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Unique nonclustered index.
Sales territory lookup table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | TerritoryID | int | X | ||
Primary key for SalesTerritory records. | |||||
UK | Name | Name(nvarchar(50)) | |||
Sales territory description | |||||
FK | CountryRegionCode | nvarchar(3) | |||
ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. | |||||
Group | nvarchar(50) | ||||
Geographic area to which the sales territory belong. | |||||
SalesYTD | money | 0.00 | |||
Sales in the territory year to date. | |||||
SalesLastYear | money | 0.00 | |||
Sales in the territory the previous year. | |||||
CostYTD | money | 0.00 | |||
Business costs in the territory year to date. | |||||
CostLastYear | money | 0.00 | |||
Business costs in the territory the previous year. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index.
Unique nonclustered index. Used to support replication samples.
Sales representative transfers to other sales territories.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key. The sales rep. Foreign key to SalesPerson.BusinessEntityID. | |||||
PK, FK | TerritoryID | int | |||
Primary key. Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. | |||||
PK | StartDate | datetime | |||
Primary key. Date the sales representive started work in the territory. | |||||
EndDate | datetime | X | |||
Date the sales representative left work in the territory. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Contains online customer orders until the order is submitted or cancelled.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | ShoppingCartItemID | int | X | ||
Primary key for ShoppingCartItem records. | |||||
ShoppingCartID | nvarchar(50) | ||||
Shopping cart identification number. | |||||
Quantity | int | 1 | |||
Product quantity ordered. | |||||
FK | ProductID | int | |||
Product ordered. Foreign key to Product.ProductID. | |||||
DateCreated | datetime | getdate() | |||
Date the time the record was created. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Nonclustered index.
Sale discounts lookup table.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK | SpecialOfferID | int | X | ||
Primary key for SpecialOffer records. | |||||
Description | nvarchar(255) | ||||
Discount description. | |||||
DiscountPct | smallmoney | 0.00 | |||
Discount precentage. | |||||
Type | nvarchar(50) | ||||
Discount type category. | |||||
Category | nvarchar(50) | ||||
Group the discount applies to such as Reseller or Customer. | |||||
StartDate | datetime | ||||
Discount start date. | |||||
EndDate | datetime | ||||
Discount end date. | |||||
MinQty | int | 0 | |||
Minimum discount percent allowed. | |||||
MaxQty | int | X | |||
Maximum discount percent allowed. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Cross-reference table mapping products to special offer discounts.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | SpecialOfferID | int | |||
Primary key for SpecialOfferProduct records. | |||||
PK, FK | ProductID | int | |||
Product identification number. Foreign key to Product.ProductID. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Nonclustered index.
Customers (resellers) of Adventure Works products.
Column | Data Type | Identity | Nullable | Default | |
---|---|---|---|---|---|
PK, FK | BusinessEntityID | int | |||
Primary key. Foreign key to Customer.BusinessEntityID. | |||||
Name | Name(nvarchar(50)) | ||||
Name of the store. | |||||
FK | SalesPersonID | int | X | ||
ID of the sales person assigned to the customer. Foreign key to SalesPerson.BusinessEntityID. | |||||
Demographics | xml | X | |||
Demographic informationg about the store such as the number of employees, annual sales and store type. | |||||
UK | rowguid | uniqueidentifier | newid() | ||
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | getdate() | |||
Date and time the record was last updated. |
Primary key (clustered) constraint
Unique nonclustered index. Used to support replication samples.
Nonclustered index.
Primary XML index.
Employee names and addresses.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Title | nvarchar(8) | X |
FirstName | Name(nvarchar(50)) | |
MiddleName | Name(nvarchar(50)) | X |
LastName | Name(nvarchar(50)) | |
Suffix | nvarchar(10) | X |
JobTitle | nvarchar(50) | |
PhoneNumber | Phone(nvarchar(25)) | X |
PhoneNumberType | Name(nvarchar(50)) | X |
EmailAddress | nvarchar(50) | X |
EmailPromotion | int | |
AddressLine1 | nvarchar(60) | |
AddressLine2 | nvarchar(60) | X |
City | nvarchar(30) | |
StateProvinceName | Name(nvarchar(50)) | |
PostalCode | nvarchar(15) | |
CountryRegionName | Name(nvarchar(50)) | |
AdditionalContactInfo | xml | X |
Returns employee name, title, and current department.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Title | nvarchar(8) | X |
FirstName | Name(nvarchar(50)) | |
MiddleName | Name(nvarchar(50)) | X |
LastName | Name(nvarchar(50)) | |
Suffix | nvarchar(10) | X |
JobTitle | nvarchar(50) | |
Department | Name(nvarchar(50)) | |
GroupName | Name(nvarchar(50)) | |
StartDate | date |
Returns employee name and current and previous departments.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Title | nvarchar(8) | X |
FirstName | Name(nvarchar(50)) | |
MiddleName | Name(nvarchar(50)) | X |
LastName | Name(nvarchar(50)) | |
Suffix | nvarchar(10) | X |
Shift | Name(nvarchar(50)) | |
Department | Name(nvarchar(50)) | |
GroupName | Name(nvarchar(50)) | |
StartDate | date | |
EndDate | date | X |
Job candidate names and resumes.
Column | Data Type | Nullable |
---|---|---|
JobCandidateID | int | |
BusinessEntityID | int | X |
Name.Prefix | nvarchar(30) | X |
Name.First | nvarchar(30) | X |
Name.Middle | nvarchar(30) | X |
Name.Last | nvarchar(30) | X |
Name.Suffix | nvarchar(30) | X |
Skills | nvarchar(max) | X |
Addr.Type | nvarchar(30) | X |
Addr.Loc.CountryRegion | nvarchar(100) | X |
Addr.Loc.State | nvarchar(100) | X |
Addr.Loc.City | nvarchar(100) | X |
Addr.PostalCode | nvarchar(20) | X |
nvarchar(max) | X | |
WebSite | nvarchar(max) | X |
ModifiedDate | datetime |
Displays the content from each education related element in the xml column Resume in the HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai. Some data may not display correctly unless supplemental language support is installed.
Column | Data Type | Nullable |
---|---|---|
JobCandidateID | int | |
Edu.Level | nvarchar(max) | X |
Edu.StartDate | datetime | X |
Edu.EndDate | datetime | X |
Edu.Degree | nvarchar(50) | X |
Edu.Major | nvarchar(50) | X |
Edu.Minor | nvarchar(50) | X |
Edu.GPA | nvarchar(5) | X |
Edu.GPAScale | nvarchar(5) | X |
Edu.School | nvarchar(100) | X |
Edu.Loc.CountryRegion | nvarchar(100) | X |
Edu.Loc.State | nvarchar(100) | X |
Edu.Loc.City | nvarchar(100) | X |
Displays the content from each employement history related element in the xml column Resume in the HumanResources.JobCandidate table. The content has been localized into French, Simplified Chinese and Thai. Some data may not display correctly unless supplemental language support is installed.
Column | Data Type | Nullable |
---|---|---|
JobCandidateID | int | |
Emp.StartDate | datetime | X |
Emp.EndDate | datetime | X |
Emp.OrgName | nvarchar(100) | X |
Emp.JobTitle | nvarchar(100) | X |
Emp.Responsibility | nvarchar(max) | X |
Emp.FunctionCategory | nvarchar(max) | X |
Emp.IndustryCategory | nvarchar(max) | X |
Emp.Loc.CountryRegion | nvarchar(max) | X |
Emp.Loc.State | nvarchar(max) | X |
Emp.Loc.City | nvarchar(max) | X |
Displays the contact name and content from each element in the xml column AdditionalContactInfo for that person.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
FirstName | Name(nvarchar(50)) | |
MiddleName | Name(nvarchar(50)) | X |
LastName | Name(nvarchar(50)) | |
TelephoneNumber | nvarchar(50) | X |
TelephoneSpecialInstructions | nvarchar(max) | X |
Street | nvarchar(50) | X |
City | nvarchar(50) | X |
StateProvince | nvarchar(50) | X |
PostalCode | nvarchar(50) | X |
CountryRegion | nvarchar(50) | X |
HomeAddressSpecialInstructions | nvarchar(max) | X |
EMailAddress | nvarchar(128) | X |
EMailSpecialInstructions | nvarchar(max) | X |
EMailTelephoneNumber | nvarchar(50) | X |
rowguid | uniqueidentifier | |
ModifiedDate | datetime |
Joins StateProvince table with CountryRegion table.
Column | Data Type | Nullable |
---|---|---|
StateProvinceID | int | |
StateProvinceCode | nchar(3) | |
IsOnlyStateProvinceFlag | Flag(bit) | |
StateProvinceName | Name(nvarchar(50)) | |
TerritoryID | int | |
CountryRegionCode | nvarchar(3) | |
CountryRegionName | Name(nvarchar(50)) |
Product names and descriptions. Product descriptions are provided in multiple languages.
Column | Data Type | Nullable |
---|---|---|
ProductID | int | |
Name | Name(nvarchar(50)) | |
ProductModel | Name(nvarchar(50)) | |
CultureID | nchar(6) | |
Description | nvarchar(400) |
Displays the content from each element in the xml column CatalogDescription for each product in the Production.ProductModel table that has catalog data.
Column | Data Type | Nullable |
---|---|---|
ProductModelID | int | |
Name | Name(nvarchar(50)) | |
Summary | nvarchar(max) | X |
Manufacturer | nvarchar(max) | X |
Copyright | nvarchar(30) | X |
ProductURL | nvarchar(256) | X |
WarrantyPeriod | nvarchar(256) | X |
WarrantyDescription | nvarchar(256) | X |
NoOfYears | nvarchar(256) | X |
MaintenanceDescription | nvarchar(256) | X |
Wheel | nvarchar(256) | X |
Saddle | nvarchar(256) | X |
Pedal | nvarchar(256) | X |
BikeFrame | nvarchar(max) | X |
Crankset | nvarchar(256) | X |
PictureAngle | nvarchar(256) | X |
PictureSize | nvarchar(256) | X |
ProductPhotoID | nvarchar(256) | X |
Material | nvarchar(256) | X |
Color | nvarchar(256) | X |
ProductLine | nvarchar(256) | X |
Style | nvarchar(256) | X |
RiderExperience | nvarchar(1024) | X |
rowguid | uniqueidentifier | |
ModifiedDate | datetime |
Displays the content from each element in the xml column Instructions for each product in the Production.ProductModel table that has manufacturing instructions.
Column | Data Type | Nullable |
---|---|---|
ProductModelID | int | |
Name | Name(nvarchar(50)) | |
Instructions | nvarchar(max) | X |
LocationID | int | X |
SetupHours | decimal(9,4) | X |
MachineHours | decimal(9,4) | X |
LaborHours | decimal(9,4) | X |
LotSize | int | X |
Step | nvarchar(1024) | X |
rowguid | uniqueidentifier | |
ModifiedDate | datetime |
Vendor (company) names and addresses .
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Name | Name(nvarchar(50)) | |
AddressType | Name(nvarchar(50)) | |
AddressLine1 | nvarchar(60) | |
AddressLine2 | nvarchar(60) | X |
City | nvarchar(30) | |
StateProvinceName | Name(nvarchar(50)) | |
PostalCode | nvarchar(15) | |
CountryRegionName | Name(nvarchar(50)) |
Vendor (company) names and the names of vendor employees to contact.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Name | Name(nvarchar(50)) | |
ContactType | Name(nvarchar(50)) | |
Title | nvarchar(8) | X |
FirstName | Name(nvarchar(50)) | |
MiddleName | Name(nvarchar(50)) | X |
LastName | Name(nvarchar(50)) | |
Suffix | nvarchar(10) | X |
PhoneNumber | Phone(nvarchar(25)) | X |
PhoneNumberType | Name(nvarchar(50)) | X |
EmailAddress | nvarchar(50) | X |
EmailPromotion | int |
Individual customers (names and addresses) that purchase Adventure Works Cycles products online.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Title | nvarchar(8) | X |
FirstName | Name(nvarchar(50)) | |
MiddleName | Name(nvarchar(50)) | X |
LastName | Name(nvarchar(50)) | |
Suffix | nvarchar(10) | X |
PhoneNumber | Phone(nvarchar(25)) | X |
PhoneNumberType | Name(nvarchar(50)) | X |
EmailAddress | nvarchar(50) | X |
EmailPromotion | int | |
AddressType | Name(nvarchar(50)) | |
AddressLine1 | nvarchar(60) | |
AddressLine2 | nvarchar(60) | X |
City | nvarchar(30) | |
StateProvinceName | Name(nvarchar(50)) | |
PostalCode | nvarchar(15) | |
CountryRegionName | Name(nvarchar(50)) | |
Demographics | xml | X |
Displays the content from each element in the xml column Demographics for each customer in the Person.Person table.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
TotalPurchaseYTD | money | X |
DateFirstPurchase | datetime | X |
BirthDate | datetime | X |
MaritalStatus | nvarchar(1) | X |
YearlyIncome | nvarchar(30) | X |
Gender | nvarchar(1) | X |
TotalChildren | int | X |
NumberChildrenAtHome | int | X |
Education | nvarchar(30) | X |
Occupation | nvarchar(30) | X |
HomeOwnerFlag | bit | X |
NumberCarsOwned | int | X |
Sales representiatives (names and addresses) and their sales-related information.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Title | nvarchar(8) | X |
FirstName | Name(nvarchar(50)) | |
MiddleName | Name(nvarchar(50)) | X |
LastName | Name(nvarchar(50)) | |
Suffix | nvarchar(10) | X |
JobTitle | nvarchar(50) | |
PhoneNumber | Phone(nvarchar(25)) | X |
PhoneNumberType | Name(nvarchar(50)) | X |
EmailAddress | nvarchar(50) | X |
EmailPromotion | int | |
AddressLine1 | nvarchar(60) | |
AddressLine2 | nvarchar(60) | X |
City | nvarchar(30) | |
StateProvinceName | Name(nvarchar(50)) | |
PostalCode | nvarchar(15) | |
CountryRegionName | Name(nvarchar(50)) | |
TerritoryName | Name(nvarchar(50)) | X |
TerritoryGroup | nvarchar(50) | X |
SalesQuota | money | X |
SalesYTD | money | |
SalesLastYear | money |
Uses PIVOT to return aggregated sales information for each sales representative.
Column | Data Type | Nullable |
---|---|---|
SalesPersonID | int | X |
FullName | nvarchar(152) | X |
JobTitle | nvarchar(50) | |
SalesTerritory | Name(nvarchar(50)) | |
2002 | money | X |
2003 | money | X |
2004 | money | X |
Stores (including store addresses) that sell Adventure Works Cycles products to consumers.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Name | Name(nvarchar(50)) | |
AddressType | Name(nvarchar(50)) | |
AddressLine1 | nvarchar(60) | |
AddressLine2 | nvarchar(60) | X |
City | nvarchar(30) | |
StateProvinceName | Name(nvarchar(50)) | |
PostalCode | nvarchar(15) | |
CountryRegionName | Name(nvarchar(50)) |
Stores (including store contacts) that sell Adventure Works Cycles products to consumers.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Name | Name(nvarchar(50)) | |
ContactType | Name(nvarchar(50)) | |
Title | nvarchar(8) | X |
FirstName | Name(nvarchar(50)) | |
MiddleName | Name(nvarchar(50)) | X |
LastName | Name(nvarchar(50)) | |
Suffix | nvarchar(10) | X |
PhoneNumber | Phone(nvarchar(25)) | X |
PhoneNumberType | Name(nvarchar(50)) | X |
EmailAddress | nvarchar(50) | X |
EmailPromotion | int |
Stores (including demographics) that sell Adventure Works Cycles products to consumers.
Column | Data Type | Nullable |
---|---|---|
BusinessEntityID | int | |
Name | Name(nvarchar(50)) | |
AnnualSales | money | X |
AnnualRevenue | money | X |
BankName | nvarchar(50) | X |
BusinessType | nvarchar(5) | X |
YearOpened | int | X |
Specialty | nvarchar(50) | X |
SquareFeet | int | X |
Brands | nvarchar(30) | X |
Internet | nvarchar(30) | X |
NumberEmployees | int | X |
Stored procedure using a recursive query to return a multi-level bill of material for the specified ProductID.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@StartProductID | int | ||
Input parameter for the stored procedure uspGetBillOfMaterials. Enter a valid ProductID from the Production.Product table. | |||
@CheckDate | datetime | ||
Input parameter for the stored procedure uspGetBillOfMaterials used to eliminate components not used after that date. Enter a valid date. |
Column | Data Type | Nullable |
---|---|---|
ProductAssemblyID | int | X |
ComponentID | int | X |
ComponentDesc | nvarchar(50) | X |
TotalQuantity | decimal(38,2) | X |
StandardCost | money | X |
ListPrice | money | X |
BOMLevel | smallint | X |
RecursionLevel | int | X |
Stored procedure using a recursive query to return the direct and indirect managers of the specified employee.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@BusinessEntityID | int | ||
Input parameter for the stored procedure uspGetEmployeeManagers. Enter a valid BusinessEntityID from the HumanResources.Employee table. |
Column | Data Type | Nullable |
---|---|---|
RecursionLevel | int | X |
BusinessEntityID | int | X |
FirstName | nvarchar(50) | X |
LastName | nvarchar(50) | X |
OrganizationNode | nvarchar(4000) | X |
ManagerFirstName | nvarchar(50) | |
ManagerLastName | nvarchar(50) |
Stored procedure using a recursive query to return the direct and indirect employees of the specified manager.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@BusinessEntityID | int | ||
Input parameter for the stored procedure uspGetManagerEmployees. Enter a valid BusinessEntityID of the manager from the HumanResources.Employee table. |
Column | Data Type | Nullable |
---|---|---|
RecursionLevel | int | X |
OrganizationNode | nvarchar(4000) | X |
ManagerFirstName | nvarchar(50) | |
ManagerLastName | nvarchar(50) | |
BusinessEntityID | int | X |
FirstName | nvarchar(50) | X |
LastName | nvarchar(50) | X |
Stored procedure using a recursive query to return all components or assemblies that directly or indirectly use the specified ProductID.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@StartProductID | int | ||
Input parameter for the stored procedure uspGetWhereUsedProductID. Enter a valid ProductID from the Production.Product table. | |||
@CheckDate | datetime | ||
Input parameter for the stored procedure uspGetWhereUsedProductID used to eliminate components not used after that date. Enter a valid date. |
Column | Data Type | Nullable |
---|---|---|
ProductAssemblyID | int | X |
ComponentID | int | X |
ComponentDesc | nvarchar(50) | X |
TotalQuantity | decimal(38,2) | X |
StandardCost | money | X |
ListPrice | money | X |
BOMLevel | smallint | X |
RecursionLevel | int | X |
Logs error information in the ErrorLog table about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without inserting error information.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@ErrorLogID | int | 0 | X |
Output parameter for the stored procedure uspLogError. Contains the ErrorLogID value corresponding to the row inserted by uspLogError in the ErrorLog table. |
Prints error information about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without printing any error information.
No parameters.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@searchString | nvarchar(1000) | ||
@useInflectional | bit | 0 | |
@useThesaurus | bit | 0 | |
@language | int | 0 |
Updates the Employee table and inserts a new row in the EmployeePayHistory table with the values specified in the input parameters.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@BusinessEntityID | int | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid BusinessEntityID from the Employee table. | |||
@JobTitle | nvarchar(50) | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a title for the employee. | |||
@HireDate | datetime | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a hire date for the employee. | |||
@RateChangeDate | datetime | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the date the rate changed for the employee. | |||
@Rate | money | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the new rate for the employee. | |||
@PayFrequency | tinyint | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the pay frequency for the employee. | |||
@CurrentFlag | Flag(bit) | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the current flag for the employee. |
Updates the Employee table with the values specified in the input parameters for the given BusinessEntityID.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@BusinessEntityID | int | ||
Input parameter for the stored procedure uspUpdateEmployeeLogin. Enter a valid EmployeeID from the Employee table. | |||
@OrganizationNode | hierarchyid | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid ManagerID for the employee. | |||
@LoginID | nvarchar(256) | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid login for the employee. | |||
@JobTitle | nvarchar(50) | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a title for the employee. | |||
@HireDate | datetime | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a hire date for the employee. | |||
@CurrentFlag | Flag(bit) | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the current flag for the employee. |
Updates the Employee table with the values specified in the input parameters for the given EmployeeID.
Parameter | Data Type | Default | Is Output |
---|---|---|---|
@BusinessEntityID | int | ||
Input parameter for the stored procedure uspUpdateEmployeePersonalInfo. Enter a valid BusinessEntityID from the HumanResources.Employee table. | |||
@NationalIDNumber | nvarchar(15) | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a national ID for the employee. | |||
@BirthDate | datetime | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a birth date for the employee. | |||
@MaritalStatus | nchar(1) | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a marital status for the employee. | |||
@Gender | nchar(1) | ||
Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a gender for the employee. |
Scalar function used in the uSalesOrderHeader trigger to set the starting account date.
No parameters.
Data Type | Nullable |
---|---|
datetime | X |
Scalar function used in the uSalesOrderHeader trigger to set the ending account date.
No parameters.
Data Type | Nullable |
---|---|
datetime | X |
Table value function returning the first name, last name, job title and contact type for a given contact.
Parameter | Data Type | Default |
---|---|---|
@PersonID | int | |
Input parameter for the table value function ufnGetContactInformation. Enter a valid PersonID from the Person.Contact table. |
Column | Data Type | Nullable |
---|---|---|
PersonID | int | |
FirstName | nvarchar(50) | X |
LastName | nvarchar(50) | X |
JobTitle | nvarchar(50) | X |
BusinessEntityType | nvarchar(50) | X |
Scalar function returning the text representation of the Status column in the Document table.
Parameter | Data Type | Default |
---|---|---|
@Status | tinyint | |
Input parameter for the scalar function ufnGetDocumentStatusText. Enter a valid integer. |
Data Type | Nullable |
---|---|
nvarchar(16) | X |
Scalar function returning the dealer price for a given product on a particular order date.
Parameter | Data Type | Default |
---|---|---|
@ProductID | int | |
Input parameter for the scalar function ufnGetProductDealerPrice. Enter a valid ProductID from the Production.Product table. | ||
@OrderDate | datetime | |
Input parameter for the scalar function ufnGetProductDealerPrice. Enter a valid order date. |
Data Type | Nullable |
---|---|
money | X |
Scalar function returning the list price for a given product on a particular order date.
Parameter | Data Type | Default |
---|---|---|
@ProductID | int | |
Input parameter for the scalar function ufnGetProductListPrice. Enter a valid ProductID from the Production.Product table. | ||
@OrderDate | datetime | |
Input parameter for the scalar function ufnGetProductListPrice. Enter a valid order date. |
Data Type | Nullable |
---|---|
money | X |
Scalar function returning the standard cost for a given product on a particular order date.
Parameter | Data Type | Default |
---|---|---|
@ProductID | int | |
Input parameter for the scalar function ufnGetProductStandardCost. Enter a valid ProductID from the Production.Product table. | ||
@OrderDate | datetime | |
Input parameter for the scalar function ufnGetProductStandardCost. Enter a valid order date. |
Data Type | Nullable |
---|---|
money | X |
Scalar function returning the text representation of the Status column in the PurchaseOrderHeader table.
Parameter | Data Type | Default |
---|---|---|
@Status | tinyint | |
Input parameter for the scalar function ufnGetPurchaseOrdertStatusText. Enter a valid integer. |
Data Type | Nullable |
---|---|
nvarchar(15) | X |
Scalar function returning the text representation of the Status column in the SalesOrderHeader table.
Parameter | Data Type | Default |
---|---|---|
@Status | tinyint | |
Input parameter for the scalar function ufnGetSalesOrderStatusText. Enter a valid integer. |
Data Type | Nullable |
---|---|
nvarchar(15) | X |
Scalar function returning the quantity of inventory in LocationID 6 (Miscellaneous Storage)for a specified ProductID.
Parameter | Data Type | Default |
---|---|---|
@ProductID | int | |
Input parameter for the scalar function ufnGetStock. Enter a valid ProductID from the Production.ProductInventory table. |
Data Type | Nullable |
---|---|
int | X |
Scalar function used by the Sales.Customer table to help set the account number.
Parameter | Data Type | Default |
---|---|---|
@Value | int | |
Input parameter for the scalar function ufnLeadingZeros. Enter a valid integer. |
Data Type | Nullable |
---|---|
varchar(8) | X |