AdventureWorks Database
AdventureWorks Sample OLTP Database
dbo (schema)
Primary filegroup for the AdventureWorks sample database.
Object Type | Count |
Tables | 3 |
Views | 0 |
Stored procedures | 6 |
Scalar functions | 10 |
Table functions | 1 |
dbo.AWBuildVersion (table)
Current version number of the AdventureWorks sample database.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SystemInformationID | tinyint (identity) | 3,0 | No | none | No | Primary key for AWBuildVersion records. |
Database Version | nvarchar | 25 | No | none | No | Version number of the database in 9.yy.mm.dd.00 format. |
VersionDate | datetime | | No | none | No | Date and time the record was last updated. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on AWBuildVersion
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_AWBuildVersion_SystemInformationID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SystemInformationID |
dbo.DatabaseLog (table)
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
DatabaseLogID | int (identity) | 10,0 | No | none | No | Primary key for DatabaseLog records. |
PostTime | datetime | | No | none | No | The date and time the DDL change occurred. |
DatabaseUser | nvarchar | 128 | No | none | No | The user who implemented the DDL change. |
Event | nvarchar | 128 | No | none | No | The type of DDL statement that was executed. |
Schema | nvarchar | 128 | Yes | none | No | The schema to which the changed object belongs. |
Object | nvarchar | 128 | Yes | none | No | The object that was changed by the DDL statment. |
TSQL | nvarchar | | No | none | No | The exact Transact-SQL statement that was executed. |
XmlEvent | xml | | No | none | No | The raw XML data generated by database trigger. |
Indexes on DatabaseLog
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_DatabaseLog_DatabaseLogID | Nonclustered index created by a primary key constraint. | Yes | Yes | NONCLUSTERED | DatabaseLogID |
dbo.ErrorLog (table)
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 Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ErrorLogID | int (identity) | 10,0 | No | none | No | Primary key for ErrorLog records. |
ErrorTime | datetime | | No | (getdate()) | No | The date and time at which the error occurred. |
UserName | nvarchar | 128 | No | none | No | The user who executed the batch in which the error occurred. |
ErrorNumber | int | 10,0 | No | none | No | The error number of the error that occurred. |
ErrorSeverity | int | 10,0 | Yes | none | No | The severity of the error that occurred. |
ErrorState | int | 10,0 | Yes | none | No | The state number of the error that occurred. |
ErrorProcedure | nvarchar | 126 | Yes | none | No | The name of the stored procedure or trigger where the error occurred. |
ErrorLine | int | 10,0 | Yes | none | No | The line number at which the error occurred. |
ErrorMessage | nvarchar | 4000 | No | none | No | The message text of the error that occurred. |
Indexes on ErrorLog
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ErrorLog_ErrorLogID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ErrorLogID |
dbo.uspGetBillOfMaterials (stored procedure)
Stored procedure using a recursive query to return a multi-level bill of material for the specified ProductID.
Parameters
Paramater Name | System Data Type | Size | Direction | Description |
@StartProductID | int | 10,0 | Input | Input parameter for the stored procedure uspGetBillOfMaterials. Enter a valid ProductID from the Production.Product table. |
@CheckDate | datetime | | Input | Input parameter for the stored procedure uspGetBillOfMaterials used to eliminate components not used after that date. Enter a valid date. |
dbo.uspGetEmployeeManagers (stored procedure)
Stored procedure using a recursive query to return the direct and indirect managers of the specified employee.
Parameters
Paramater Name | System Data Type | Size | Direction | Description |
@EmployeeID | int | 10,0 | Input | Input parameter for the stored procedure uspGetEmployeeManagers. Enter a valid EmployeeID from the HumanResources.Employee table. |
dbo.uspGetManagerEmployees (stored procedure)
Stored procedure using a recursive query to return the direct and indirect employees of the specified manager.
Parameters
Paramater Name | System Data Type | Size | Direction | Description |
@ManagerID | int | 10,0 | Input | Input parameter for the stored procedure uspGetManagerEmployees. Enter a valid ManagerID from the HumanResources.Employee table. |
dbo.uspGetWhereUsedProductID (stored procedure)
Stored procedure using a recursive query to return all components or assemblies that directly or indirectly use the specified ProductID.
Parameters
Paramater Name | System Data Type | Size | Direction | Description |
@StartProductID | int | 10,0 | Input | Input parameter for the stored procedure uspGetWhereUsedProductID. Enter a valid ProductID from the Production.Product table. |
@CheckDate | datetime | | Input | Input parameter for the stored procedure uspGetWhereUsedProductID used to eliminate components not used after that date. Enter a valid date. |
dbo.uspLogError (stored procedure)
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.
Parameters
Paramater Name | System Data Type | Size | Direction | Description |
@ErrorLogID | int | 10,0 | Output | Output parameter for the stored procedure uspLogError. Contains the ErrorLogID value corresponding to the row inserted by uspLogError in the ErrorLog table. |
dbo.uspPrintError (stored procedure)
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.ufnGetAccountingEndDate (scalar function)
Scalar function used in the uSalesOrderHeader trigger to set the starting account date.
Returns datetime
dbo.ufnGetAccountingStartDate (scalar function)
Scalar function used in the uSalesOrderHeader trigger to set the ending account date.
Returns datetime
dbo.ufnGetDocumentStatusText (scalar function)
Scalar function returning the text representation of the Status column in the Document table.
Returns nvarchar(16)
Parameters
Paramater Name | System Data Type | Size | Description |
@Status | tinyint | 3,0 | Input parameter for the scalar function ufnGetDocumentStatusText. Enter a valid integer. |
dbo.ufnGetProductDealerPrice (scalar function)
Scalar function returning the dealer price for a given product on a particular order date.
Returns money(19,4)
Parameters
Paramater Name | System Data Type | Size | Description |
@ProductID | int | 10,0 | 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. |
dbo.ufnGetProductListPrice (scalar function)
Scalar function returning the list price for a given product on a particular order date.
Returns money(19,4)
Parameters
Paramater Name | System Data Type | Size | Description |
@ProductID | int | 10,0 | 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. |
dbo.ufnGetProductStandardCost (scalar function)
Scalar function returning the standard cost for a given product on a particular order date.
Returns money(19,4)
Parameters
Paramater Name | System Data Type | Size | Description |
@ProductID | int | 10,0 | 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. |
dbo.ufnGetPurchaseOrderStatusText (scalar function)
Scalar function returning the text representation of the Status column in the PurchaseOrderHeader table.
Returns nvarchar(15)
Parameters
Paramater Name | System Data Type | Size | Description |
@Status | tinyint | 3,0 | Input parameter for the scalar function ufnGetPurchaseOrdertStatusText. Enter a valid integer. |
dbo.ufnGetSalesOrderStatusText (scalar function)
Scalar function returning the text representation of the Status column in the SalesOrderHeader table.
Returns nvarchar(15)
Parameters
Paramater Name | System Data Type | Size | Description |
@Status | tinyint | 3,0 | Input parameter for the scalar function ufnGetSalesOrderStatusText. Enter a valid integer. |
dbo.ufnGetStock (scalar function)
Scalar function returning the quantity of inventory in LocationID 6 (Miscellaneous Storage)for a specified ProductID.
Returns int(10,0)
Parameters
Paramater Name | System Data Type | Size | Description |
@ProductID | int | 10,0 | Input parameter for the scalar function ufnGetStock. Enter a valid ProductID from the Production.ProductInventory table. |
dbo.ufnLeadingZeros (scalar function)
Scalar function used by the Sales.Customer table to help set the account number.
Returns varchar(8)
Parameters
Paramater Name | System Data Type | Size | Description |
@Value | int | 10,0 | Input parameter for the scalar function ufnLeadingZeros. Enter a valid integer. |
dbo.ufnGetContactInformation (table function)
Table value function returning the first name, last name, job title and contact type for a given contact.
Parameters
Paramater Name | System Data Type | Size | Description |
@ContactID | int | 10,0 | Input parameter for the table value function ufnGetContactInformation. Enter a valid ContactID from the Person.Contact table. |
Column Name | System Data Type | Allow Null |
ContactID | int | No |
FirstName | nvarchar | Yes |
LastName | nvarchar | Yes |
JobTitle | nvarchar | Yes |
ContactType | nvarchar | Yes |
guest (schema)
Object Type | Count |
Tables | 0 |
Views | 0 |
Stored procedures | 0 |
Scalar functions | 0 |
Table functions | 0 |
HumanResources (schema)
Contains objects related to employees and departments.
Object Type | Count |
Tables | 7 |
Views | 6 |
Stored procedures | 3 |
Scalar functions | 0 |
Table functions | 0 |
HumanResources.Department (table)
Lookup table containing the departments within the Adventure Works Cycles company.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
DepartmentID | smallint (identity) | 5,0 | No | none | No | Primary key for Department records. |
Name | nvarchar | 50 | No | none | No | Name of the department. |
GroupName | nvarchar | 50 | No | none | No | Name of the group to which the department belongs. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Department
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Department_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
PK_Department_DepartmentID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | DepartmentID |
HumanResources.Employee (table)
Employee information such as salary, department, and title.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
EmployeeID | int (identity) | 10,0 | No | none | No | Primary key for Employee records. |
NationalIDNumber | nvarchar | 15 | No | none | No | Unique national identification number such as a social security number. |
ContactID | int | 10,0 | No | none | No | Identifies the employee in the Contact table. Foreign key to Contact.ContactID. |
LoginID | nvarchar | 256 | No | none | No | Network login. |
ManagerID | int | 10,0 | Yes | none | No | Manager to whom the employee is assigned. Foreign Key to Employee.M |
Title | nvarchar | 50 | No | none | No | Work title such as Buyer or Sales Representative. |
BirthDate | datetime | | No | none | No | Date of birth. |
MaritalStatus | nchar | 1 | No | none | No | M = Married, S = Single |
Gender | nchar | 1 | No | none | No | M = Male, F = Female |
HireDate | datetime | | No | none | No | Employee hired on this date. |
SalariedFlag | bit | | No | ((1)) | No | Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. |
VacationHours | smallint | 5,0 | No | ((0)) | No | Number of available vacation hours. |
SickLeaveHours | smallint | 5,0 | No | ((0)) | No | Number of available sick leave hours. |
CurrentFlag | bit | | No | ((1)) | No | 0 = Inactive, 1 = Active |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Employee
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Employee_LoginID | Unique nonclustered index. | No | Yes | NONCLUSTERED | LoginID |
AK_Employee_NationalIDNumber | Unique nonclustered index. | No | Yes | NONCLUSTERED | NationalIDNumber |
AK_Employee_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
IX_Employee_ManagerID | Nonclustered index. | No | No | NONCLUSTERED | ManagerID |
PK_Employee_EmployeeID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | EmployeeID |
Foreign Keys in Employee
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_Employee_Contact_ContactID | ContactID | Person.Contact (ContactID) | Foreign key constraint referencing Contact.ContactID. |
FK_Employee_Employee_ManagerID | ManagerID | HumanResources.Employee (EmployeeID) | Foreign key constraint referencing Employee.ManagerID. |
HumanResources.EmployeeAddress (table)
Cross-reference table mapping employees to their address(es).
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
EmployeeID | int | 10,0 | No | none | No | Primary key. Foreign key to Employee.EmployeeID. |
AddressID | int | 10,0 | No | none | No | Primary key. Foreign key to Address.AddressID. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on EmployeeAddress
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_EmployeeAddress_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_EmployeeAddress_EmployeeID_AddressID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | EmployeeID, AddressID |
Foreign Keys in EmployeeAddress
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_EmployeeAddress_Address_AddressID | AddressID | Person.Address (AddressID) | Foreign key constraint referencing Address.AddressID. |
FK_EmployeeAddress_Employee_EmployeeID | EmployeeID | HumanResources.Employee (EmployeeID) | Foreign key constraint referencing Employee.EmployeeID. |
HumanResources.EmployeeDepartmentHistory (table)
Employee department transfers.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
EmployeeID | int | 10,0 | No | none | No | Employee identification number. Foreign key to Employee.EmployeeID. |
DepartmentID | smallint | 5,0 | No | none | No | Department in which the employee worked including currently. Foreign key to Department.DepartmentID. |
ShiftID | tinyint | 3,0 | No | none | No | Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. |
StartDate | datetime | | No | none | No | Date the employee started work in the department. |
EndDate | datetime | | Yes | none | No | Date the employee left the department. NULL = Current department. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on EmployeeDepartmentHistory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_EmployeeDepartmentHistory_DepartmentID | Nonclustered index. | No | No | NONCLUSTERED | DepartmentID |
IX_EmployeeDepartmentHistory_ShiftID | Nonclustered index. | No | No | NONCLUSTERED | ShiftID |
PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | EmployeeID, StartDate, DepartmentID, ShiftID |
Foreign Keys in EmployeeDepartmentHistory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_EmployeeDepartmentHistory_Department_DepartmentID | DepartmentID | HumanResources.Department (DepartmentID) | Foreign key constraint referencing Department.DepartmentID. |
FK_EmployeeDepartmentHistory_Employee_EmployeeID | EmployeeID | HumanResources.Employee (EmployeeID) | Foreign key constraint referencing Employee.EmployeeID. |
FK_EmployeeDepartmentHistory_Shift_ShiftID | ShiftID | HumanResources.Shift (ShiftID) | Foreign key constraint referencing Shift.ShiftID |
HumanResources.EmployeePayHistory (table)
Employee pay history.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
EmployeeID | int | 10,0 | No | none | No | Employee identification number. Foreign key to Employee.EmployeeID. |
RateChangeDate | datetime | | No | none | No | Date the change in pay is effective |
Rate | money | 19,4 | No | none | No | Salary hourly rate. |
PayFrequency | tinyint | 3,0 | No | none | No | 1 = Salary received monthly, 2 = Salary received biweekly |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on EmployeePayHistory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_EmployeePayHistory_EmployeeID_RateChangeDate | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | EmployeeID, RateChangeDate |
Foreign Keys in EmployeePayHistory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_EmployeePayHistory_Employee_EmployeeID | EmployeeID | HumanResources.Employee (EmployeeID) | Foreign key constraint referencing Employee.EmployeeID. |
HumanResources.JobCandidate (table)
Résumés submitted to Human Resources by job applicants.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
JobCandidateID | int (identity) | 10,0 | No | none | No | Primary key for JobCandidate records. |
EmployeeID | int | 10,0 | Yes | none | No | Employee identification number if applicant was hired. Foreign key to Employee.EmployeeID. |
Resume | xml | | Yes | none | No | Résumé in XML format. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on JobCandidate
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_JobCandidate_EmployeeID | Nonclustered index. | No | No | NONCLUSTERED | EmployeeID |
PK_JobCandidate_JobCandidateID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | JobCandidateID |
Foreign Keys in JobCandidate
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_JobCandidate_Employee_EmployeeID | EmployeeID | HumanResources.Employee (EmployeeID) | Foreign key constraint referencing Employee.EmployeeID. |
HumanResources.Shift (table)
Work shift lookup table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ShiftID | tinyint (identity) | 3,0 | No | none | No | Primary key for Shift records. |
Name | nvarchar | 50 | No | none | No | Shift description. |
StartTime | datetime | | No | none | No | Shift start time. |
EndTime | datetime | | No | none | No | Shift end time. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Shift
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Shift_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_Shift_StartTime_EndTime | Unique nonclustered index. | No | Yes | NONCLUSTERED | StartTime, EndTime |
PK_Shift_ShiftID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ShiftID |
HumanResources.vEmployee (view)
Employee names and addresses.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
EmployeeID | int | 10,0 | No | none | No |
Title | nvarchar | 8 | Yes | none | No |
FirstName | nvarchar | 50 | No | none | No |
MiddleName | nvarchar | 50 | Yes | none | No |
LastName | nvarchar | 50 | No | none | No |
Suffix | nvarchar | 10 | Yes | none | No |
JobTitle | nvarchar | 50 | No | none | No |
Phone | nvarchar | 25 | Yes | none | No |
EmailAddress | nvarchar | 50 | Yes | none | No |
EmailPromotion | int | 10,0 | No | none | No |
AddressLine1 | nvarchar | 60 | No | none | No |
AddressLine2 | nvarchar | 60 | Yes | none | No |
City | nvarchar | 30 | No | none | No |
StateProvinceName | nvarchar | 50 | No | none | No |
PostalCode | nvarchar | 15 | No | none | No |
CountryRegionName | nvarchar | 50 | No | none | No |
AdditionalContactInfo | xml | | Yes | none | No |
HumanResources.vEmployeeDepartment (view)
Returns employee name, title, and current department.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
EmployeeID | int | 10,0 | No | none | No |
Title | nvarchar | 8 | Yes | none | No |
FirstName | nvarchar | 50 | No | none | No |
MiddleName | nvarchar | 50 | Yes | none | No |
LastName | nvarchar | 50 | No | none | No |
Suffix | nvarchar | 10 | Yes | none | No |
JobTitle | nvarchar | 50 | No | none | No |
Department | nvarchar | 50 | No | none | No |
GroupName | nvarchar | 50 | No | none | No |
StartDate | datetime | | No | none | No |
HumanResources.vEmployeeDepartmentHistory (view)
Returns employee name and current and previous departments.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
EmployeeID | int | 10,0 | No | none | No |
Title | nvarchar | 8 | Yes | none | No |
FirstName | nvarchar | 50 | No | none | No |
MiddleName | nvarchar | 50 | Yes | none | No |
LastName | nvarchar | 50 | No | none | No |
Suffix | nvarchar | 10 | Yes | none | No |
Shift | nvarchar | 50 | No | none | No |
Department | nvarchar | 50 | No | none | No |
GroupName | nvarchar | 50 | No | none | No |
StartDate | datetime | | No | none | No |
EndDate | datetime | | Yes | none | No |
HumanResources.vJobCandidate (view)
Job candidate names and resumes.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
JobCandidateID | int (identity) | 10,0 | No | none | No |
EmployeeID | int | 10,0 | Yes | none | No |
Name.Prefix | nvarchar | 30 | Yes | none | No |
Name.First | nvarchar | 30 | Yes | none | No |
Name.Middle | nvarchar | 30 | Yes | none | No |
Name.Last | nvarchar | 30 | Yes | none | No |
Name.Suffix | nvarchar | 30 | Yes | none | No |
Skills | nvarchar | | Yes | none | No |
Addr.Type | nvarchar | 30 | Yes | none | No |
Addr.Loc.CountryRegion | nvarchar | 100 | Yes | none | No |
Addr.Loc.State | nvarchar | 100 | Yes | none | No |
Addr.Loc.City | nvarchar | 100 | Yes | none | No |
Addr.PostalCode | nvarchar | 20 | Yes | none | No |
EMail | nvarchar | | Yes | none | No |
WebSite | nvarchar | | Yes | none | No |
ModifiedDate | datetime | | No | none | No |
HumanResources.vJobCandidateEducation (view)
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 Name | System Data Type | Size | Allow Null | Default | Is Computed |
JobCandidateID | int (identity) | 10,0 | No | none | No |
Edu.Level | nvarchar | | Yes | none | No |
Edu.StartDate | datetime | | Yes | none | No |
Edu.EndDate | datetime | | Yes | none | No |
Edu.Degree | nvarchar | 50 | Yes | none | No |
Edu.Major | nvarchar | 50 | Yes | none | No |
Edu.Minor | nvarchar | 50 | Yes | none | No |
Edu.GPA | nvarchar | 5 | Yes | none | No |
Edu.GPAScale | nvarchar | 5 | Yes | none | No |
Edu.School | nvarchar | 100 | Yes | none | No |
Edu.Loc.CountryRegion | nvarchar | 100 | Yes | none | No |
Edu.Loc.State | nvarchar | 100 | Yes | none | No |
Edu.Loc.City | nvarchar | 100 | Yes | none | No |
HumanResources.vJobCandidateEmployment (view)
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 Name | System Data Type | Size | Allow Null | Default | Is Computed |
JobCandidateID | int (identity) | 10,0 | No | none | No |
Emp.StartDate | datetime | | Yes | none | No |
Emp.EndDate | datetime | | Yes | none | No |
Emp.OrgName | nvarchar | 100 | Yes | none | No |
Emp.JobTitle | nvarchar | 100 | Yes | none | No |
Emp.Responsibility | nvarchar | | Yes | none | No |
Emp.FunctionCategory | nvarchar | | Yes | none | No |
Emp.IndustryCategory | nvarchar | | Yes | none | No |
Emp.Loc.CountryRegion | nvarchar | | Yes | none | No |
Emp.Loc.State | nvarchar | | Yes | none | No |
Emp.Loc.City | nvarchar | | Yes | none | No |
HumanResources.uspUpdateEmployeeHireInfo (stored procedure)
Updates the Employee table and inserts a new row in the EmployeePayHistory table with the values specified in the input parameters.
Parameters
Paramater Name | System Data Type | Size | Direction | Description |
@EmployeeID | int | 10,0 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid EmployeeID from the Employee table. |
@Title | nvarchar | 50 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a title for the employee. |
@HireDate | datetime | | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a hire date for the employee. |
@RateChangeDate | datetime | | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the date the rate changed for the employee. |
@Rate | money | 19,4 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the new rate for the employee. |
@PayFrequency | tinyint | 3,0 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the pay frequency for the employee. |
@CurrentFlag | bit | | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the current flag for the employee. |
HumanResources.uspUpdateEmployeeLogin (stored procedure)
Updates the Employee table with the values specified in the input parameters for the given EmployeeID.
Parameters
Paramater Name | System Data Type | Size | Direction | Description |
@EmployeeID | int | 10,0 | Input | Input parameter for the stored procedure uspUpdateEmployeeLogin. Enter a valid EmployeeID from the Employee table. |
@ManagerID | int | 10,0 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid ManagerID for the employee. |
@LoginID | nvarchar | 256 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a valid login for the employee. |
@Title | nvarchar | 50 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a title for the employee. |
@HireDate | datetime | | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a hire date for the employee. |
@CurrentFlag | bit | | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter the current flag for the employee. |
HumanResources.uspUpdateEmployeePersonalInfo (stored procedure)
Updates the Employee table with the values specified in the input parameters for the given EmployeeID.
Parameters
Paramater Name | System Data Type | Size | Direction | Description |
@EmployeeID | int | 10,0 | Input | Input parameter for the stored procedure uspUpdateEmployeePersonalInfo. Enter a valid EmployeeID from the HumanResources.Employee table. |
@NationalIDNumber | nvarchar | 15 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a national ID for the employee. |
@BirthDate | datetime | | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a birth date for the employee. |
@MaritalStatus | nchar | 1 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a marital status for the employee. |
@Gender | nchar | 1 | Input | Input parameter for the stored procedure uspUpdateEmployeeHireInfo. Enter a gender for the employee. |
Person (schema)
Contains objects related to names and addresses of customers, vendors, and employees
Object Type | Count |
Tables | 6 |
Views | 2 |
Stored procedures | 0 |
Scalar functions | 0 |
Table functions | 0 |
Person.Address (table)
Street address information for customers, employees, and vendors.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
AddressID | int (identity) | 10,0 | No | none | No | Primary key for Address records. |
AddressLine1 | nvarchar | 60 | No | none | No | First street address line. |
AddressLine2 | nvarchar | 60 | Yes | none | No | Second street address line. |
City | nvarchar | 30 | No | none | No | Name of the city. |
StateProvinceID | int | 10,0 | No | none | No | Unique identification number for the state or province. Foreign key to StateProvince table. |
PostalCode | nvarchar | 15 | No | none | No | Postal code for the street address. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Address
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Address_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode | Nonclustered index. | No | Yes | NONCLUSTERED | AddressLine1, AddressLine2, City, StateProvinceID, PostalCode |
IX_Address_StateProvinceID | Nonclustered index. | No | No | NONCLUSTERED | StateProvinceID |
PK_Address_AddressID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | AddressID |
Foreign Keys in Address
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_Address_StateProvince_StateProvinceID | StateProvinceID | Person.StateProvince (StateProvinceID) | Foreign key constraint referencing StateProvince.StateProvinceID. |
Person.AddressType (table)
Types of addresses stored in the Address table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
AddressTypeID | int (identity) | 10,0 | No | none | No | Primary key for AddressType records. |
Name | nvarchar | 50 | No | none | No | Address type description. For example, Billing, Home, or Shipping. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on AddressType
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_AddressType_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_AddressType_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_AddressType_AddressTypeID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | AddressTypeID |
Person.Contact (table)
Names of each employee, customer contact, and vendor contact.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ContactID | int (identity) | 10,0 | No | none | No | Primary key for Contact records. |
NameStyle | bit | | No | ((0)) | No | 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 | Yes | none | No | A courtesy title. For example, Mr. or Ms. |
FirstName | nvarchar | 50 | No | none | No | First name of the person. |
MiddleName | nvarchar | 50 | Yes | none | No | Middle name or middle initial of the person. |
LastName | nvarchar | 50 | No | none | No | Last name of the person. |
Suffix | nvarchar | 10 | Yes | none | No | Surname suffix. For example, Sr. or Jr. |
EmailAddress | nvarchar | 50 | Yes | none | No | E-mail address for the person. |
EmailPromotion | int | 10,0 | No | ((0)) | No | 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. |
Phone | nvarchar | 25 | Yes | none | No | Phone number associated with the person. |
PasswordHash | varchar | 128 | No | none | No | Password for the e-mail account. |
PasswordSalt | varchar | 10 | No | none | No | Random value concatenated with the password string before the password is hashed. |
AdditionalContactInfo | xml | | Yes | none | No | Additional contact information about the person stored in xml format. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Contact
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Contact_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
IX_Contact_EmailAddress | Nonclustered index. | No | No | NONCLUSTERED | EmailAddress |
PK_Contact_ContactID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ContactID |
PXML_Contact_AddContact | Primary XML index. | No | No | XML | AdditionalContactInfo |
Person.ContactType (table)
Lookup table containing the types of contacts stored in Contact.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ContactTypeID | int (identity) | 10,0 | No | none | No | Primary key for ContactType records. |
Name | nvarchar | 50 | No | none | No | Contact type description. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ContactType
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_ContactType_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
PK_ContactType_ContactTypeID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ContactTypeID |
Person.CountryRegion (table)
Lookup table containing the ISO standard codes for countries and regions.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CountryRegionCode | nvarchar | 3 | No | none | No | ISO standard code for countries and regions. |
Name | nvarchar | 50 | No | none | No | Country or region name. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on CountryRegion
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_CountryRegion_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
PK_CountryRegion_CountryRegionCode | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CountryRegionCode |
Person.StateProvince (table)
State and province lookup table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
StateProvinceID | int (identity) | 10,0 | No | none | No | Primary key for StateProvince records. |
StateProvinceCode | nchar | 3 | No | none | No | ISO standard state or province code. |
CountryRegionCode | nvarchar | 3 | No | none | No | ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. |
IsOnlyStateProvinceFlag | bit | | No | ((1)) | No | 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. |
Name | nvarchar | 50 | No | none | No | State or province description. |
TerritoryID | int | 10,0 | No | none | No | ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on StateProvince
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_StateProvince_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_StateProvince_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
AK_StateProvince_StateProvinceCode_CountryRegionCode | Unique nonclustered index. | No | Yes | NONCLUSTERED | StateProvinceCode, CountryRegionCode |
PK_StateProvince_StateProvinceID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | StateProvinceID |
Foreign Keys in StateProvince
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_StateProvince_CountryRegion_CountryRegionCode | CountryRegionCode | Person.CountryRegion (CountryRegionCode) | Foreign key constraint referencing CountryRegion.CountryRegionCode. |
FK_StateProvince_SalesTerritory_TerritoryID | TerritoryID | Sales.SalesTerritory (TerritoryID) | Foreign key constraint referencing SalesTerritory.TerritoryID. |
Person.vAdditionalContactInfo (view)
Displays the contact name and content from each element in the xml column AdditionalContactInfo for that person.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
ContactID | int (identity) | 10,0 | No | none | No |
FirstName | nvarchar | 50 | No | none | No |
MiddleName | nvarchar | 50 | Yes | none | No |
LastName | nvarchar | 50 | No | none | No |
TelephoneNumber | nvarchar | 50 | Yes | none | No |
TelephoneSpecialInstructions | nvarchar | | Yes | none | No |
Street | nvarchar | 50 | Yes | none | No |
City | nvarchar | 50 | Yes | none | No |
StateProvince | nvarchar | 50 | Yes | none | No |
PostalCode | nvarchar | 50 | Yes | none | No |
CountryRegion | nvarchar | 50 | Yes | none | No |
HomeAddressSpecialInstructions | nvarchar | | Yes | none | No |
EMailAddress | nvarchar | 128 | Yes | none | No |
EMailSpecialInstructions | nvarchar | | Yes | none | No |
EMailTelephoneNumber | nvarchar | 50 | Yes | none | No |
rowguid | uniqueidentifier | | No | none | No |
ModifiedDate | datetime | | No | none | No |
Person.vStateProvinceCountryRegion (view)
Joins StateProvince table with CountryRegion table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
StateProvinceID | int | 10,0 | No | none | No |
StateProvinceCode | nchar | 3 | No | none | No |
IsOnlyStateProvinceFlag | bit | | No | none | No |
StateProvinceName | nvarchar | 50 | No | none | No |
TerritoryID | int | 10,0 | No | none | No |
CountryRegionCode | nvarchar | 3 | No | none | No |
CountryRegionName | nvarchar | 50 | No | none | No |
Indexes on vStateProvinceCountryRegion
Index Name | Description | Is Unique | Index Type | Columns |
IX_vStateProvinceCountryRegion | Clustered index on the view vStateProvinceCountryRegion. | Yes | CLUSTERED | StateProvinceID, CountryRegionCode |
Production (schema)
Contains objects related to products, inventory, and manufacturing.
Object Type | Count |
Tables | 25 |
Views | 3 |
Stored procedures | 0 |
Scalar functions | 0 |
Table functions | 0 |
Production.BillOfMaterials (table)
Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
BillOfMaterialsID | int (identity) | 10,0 | No | none | No | Primary key for BillOfMaterials records. |
ProductAssemblyID | int | 10,0 | Yes | none | No | Parent product identification number. Foreign key to Product.ProductID. |
ComponentID | int | 10,0 | No | none | No | Component identification number. Foreign key to Product.ProductID. |
StartDate | datetime | | No | (getdate()) | No | Date the component started being used in the assembly item. |
EndDate | datetime | | Yes | none | No | Date the component stopped being used in the assembly item. |
UnitMeasureCode | nchar | 3 | No | none | No | Standard code identifying the unit of measure for the quantity. |
BOMLevel | smallint | 5,0 | No | none | No | Indicates the depth the component is from its parent (AssemblyID). |
PerAssemblyQty | decimal | 8,2 | No | ((1.00)) | No | Quantity of the component needed to create the assembly. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on BillOfMaterials
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate | Clustered index. | No | Yes | CLUSTERED | ProductAssemblyID, ComponentID, StartDate |
IX_BillOfMaterials_UnitMeasureCode | Nonclustered index. | No | No | NONCLUSTERED | UnitMeasureCode |
PK_BillOfMaterials_BillOfMaterialsID | Nonclustered index created by a primary key constraint. | Yes | Yes | NONCLUSTERED | BillOfMaterialsID |
Foreign Keys in BillOfMaterials
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_BillOfMaterials_Product_ComponentID | ComponentID | Production.Product (ProductID) | Foreign key constraint referencing Product.ComponentID. |
FK_BillOfMaterials_Product_ProductAssemblyID | ProductAssemblyID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductAssemblyID. |
FK_BillOfMaterials_UnitMeasure_UnitMeasureCode | UnitMeasureCode | Production.UnitMeasure (UnitMeasureCode) | Foreign key constraint referencing UnitMeasure.UnitMeasureCode. |
Production.Culture (table)
Lookup table containing the languages in which some AdventureWorks data is stored.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CultureID | nchar | 6 | No | none | No | Primary key for Culture records. |
Name | nvarchar | 50 | No | none | No | Culture description. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Culture
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Culture_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
PK_Culture_CultureID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CultureID |
Production.Document (table)
Product maintenance documents.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
DocumentID | int (identity) | 10,0 | No | none | No | Primary key for Document records. |
Title | nvarchar | 50 | No | none | No | Title of the document. |
FileName | nvarchar | 400 | No | none | No | Directory path and file name of the document |
FileExtension | nvarchar | 8 | No | none | No | File extension indicating the document type. For example, .doc or .txt. |
Revision | nchar | 5 | No | none | No | Revision number of the document. |
ChangeNumber | int | 10,0 | No | ((0)) | No | Engineering change approval number. |
Status | tinyint | 3,0 | No | none | No | 1 = Pending approval, 2 = Approved, 3 = Obsolete |
DocumentSummary | nvarchar | | Yes | none | No | Document abstract. |
Document | varbinary | | Yes | none | No | Complete document. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Document
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Document_FileName_Revision | Unique nonclustered index. | No | Yes | NONCLUSTERED | FileName, Revision |
PK_Document_DocumentID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | DocumentID |
Production.Illustration (table)
Bicycle assembly diagrams.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
IllustrationID | int (identity) | 10,0 | No | none | No | Primary key for Illustration records. |
Diagram | xml | | Yes | none | No | Illustrations used in manufacturing instructions. Stored as XML. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Illustration
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_Illustration_IllustrationID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | IllustrationID |
Production.Location (table)
Product inventory and manufacturing locations.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
LocationID | smallint (identity) | 5,0 | No | none | No | Primary key for Location records. |
Name | nvarchar | 50 | No | none | No | Location description. |
CostRate | smallmoney | 10,4 | No | ((0.00)) | No | Standard hourly cost of the manufacturing location. |
Availability | decimal | 8,2 | No | ((0.00)) | No | Work capacity (in hours) of the manufacturing location. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Location
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Location_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
PK_Location_LocationID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | LocationID |
Production.Product (table)
Products sold or used in the manfacturing of sold products.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductID | int (identity) | 10,0 | No | none | No | Primary key for Product records. |
Name | nvarchar | 50 | No | none | No | Name of the product. |
ProductNumber | nvarchar | 25 | No | none | No | Unique product identification number. |
MakeFlag | bit | | No | ((1)) | No | 0 = Product is purchased, 1 = Product is manufactured in-house. |
FinishedGoodsFlag | bit | | No | ((1)) | No | 0 = Product is not a salable item. 1 = Product is salable. |
Color | nvarchar | 15 | Yes | none | No | Product color. |
SafetyStockLevel | smallint | 5,0 | No | none | No | Minimum inventory quantity. |
ReorderPoint | smallint | 5,0 | No | none | No | Inventory level that triggers a purchase order or work order. |
StandardCost | money | 19,4 | No | none | No | Standard cost of the product. |
ListPrice | money | 19,4 | No | none | No | Selling price. |
Size | nvarchar | 5 | Yes | none | No | Product size. |
SizeUnitMeasureCode | nchar | 3 | Yes | none | No | Unit of measure for Size column. |
WeightUnitMeasureCode | nchar | 3 | Yes | none | No | Unit of measure for Weight column. |
Weight | decimal | 8,2 | Yes | none | No | Product weight. |
DaysToManufacture | int | 10,0 | No | none | No | Number of days required to manufacture the product. |
ProductLine | nchar | 2 | Yes | none | No | R = Road, M = Mountain, T = Touring, S = Standard |
Class | nchar | 2 | Yes | none | No | H = High, M = Medium, L = Low |
Style | nchar | 2 | Yes | none | No | W = Womens, M = Mens, U = Universal |
ProductSubcategoryID | int | 10,0 | Yes | none | No | Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID. |
ProductModelID | int | 10,0 | Yes | none | No | Product is a member of this product model. Foreign key to ProductModel.ProductModelID. |
SellStartDate | datetime | | No | none | No | Date the product was available for sale. |
SellEndDate | datetime | | Yes | none | No | Date the product was no longer available for sale. |
DiscontinuedDate | datetime | | Yes | none | No | Date the product was discontinued. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Product
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Product_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_Product_ProductNumber | Unique nonclustered index. | No | Yes | NONCLUSTERED | ProductNumber |
AK_Product_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_Product_ProductID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductID |
Production.ProductCategory (table)
High-level product categorization.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductCategoryID | int (identity) | 10,0 | No | none | No | Primary key for ProductCategory records. |
Name | nvarchar | 50 | No | none | No | Category description. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductCategory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_ProductCategory_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_ProductCategory_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_ProductCategory_ProductCategoryID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductCategoryID |
Production.ProductCostHistory (table)
Changes in the cost of a product over time.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID |
StartDate | datetime | | No | none | No | Product cost start date. |
EndDate | datetime | | Yes | none | No | Product cost end date. |
StandardCost | money | 19,4 | No | none | No | Standard cost of the product. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductCostHistory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ProductCostHistory_ProductID_StartDate | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductID, StartDate |
Foreign Keys in ProductCostHistory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductCostHistory_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
Production.ProductDescription (table)
Product descriptions in several languages.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductDescriptionID | int (identity) | 10,0 | No | none | No | Primary key for ProductDescription records. |
Description | nvarchar | 400 | No | none | No | Description of the product. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductDescription
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_ProductDescription_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_ProductDescription_ProductDescriptionID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductDescriptionID |
Production.ProductDocument (table)
Cross-reference table mapping products to related product documents.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
DocumentID | int | 10,0 | No | none | No | Document identification number. Foreign key to Document.DocumentID. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductDocument
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ProductDocument_ProductID_DocumentID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductID, DocumentID |
Foreign Keys in ProductDocument
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductDocument_Document_DocumentID | DocumentID | Production.Document (DocumentID) | Foreign key constraint referencing Document.DocumentID. |
FK_ProductDocument_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
Production.ProductInventory (table)
Product inventory information.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
LocationID | smallint | 5,0 | No | none | No | Inventory location identification number. Foreign key to Location.LocationID. |
Shelf | nvarchar | 10 | No | none | No | Storage compartment within an inventory location. |
Bin | tinyint | 3,0 | No | none | No | Storage container on a shelf in an inventory location. |
Quantity | smallint | 5,0 | No | ((0)) | No | Quantity of products in the inventory location. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductInventory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ProductInventory_ProductID_LocationID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductID, LocationID |
Foreign Keys in ProductInventory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductInventory_Location_LocationID | LocationID | Production.Location (LocationID) | Foreign key constraint referencing Location.LocationID. |
FK_ProductInventory_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
Production.ProductListPriceHistory (table)
Changes in the list price of a product over time.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID |
StartDate | datetime | | No | none | No | List price start date. |
EndDate | datetime | | Yes | none | No | List price end date |
ListPrice | money | 19,4 | No | none | No | Product list price. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductListPriceHistory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ProductListPriceHistory_ProductID_StartDate | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductID, StartDate |
Foreign Keys in ProductListPriceHistory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductListPriceHistory_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
Production.ProductModel (table)
Product model classification.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductModelID | int (identity) | 10,0 | No | none | No | Primary key for ProductModel records. |
Name | nvarchar | 50 | No | none | No | Product model description. |
CatalogDescription | xml | | Yes | none | No | Detailed product catalog information in xml format. |
Instructions | xml | | Yes | none | No | Manufacturing instructions in xml format. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductModel
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_ProductModel_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_ProductModel_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_ProductModel_ProductModelID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductModelID |
PXML_ProductModel_CatalogDescription | Primary XML index. | No | No | XML | CatalogDescription |
PXML_ProductModel_Instructions | Primary XML index. | No | No | XML | Instructions |
Production.ProductModelIllustration (table)
Cross-reference table mapping product models and illustrations.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductModelID | int | 10,0 | No | none | No | Primary key. Foreign key to ProductModel.ProductModelID. |
IllustrationID | int | 10,0 | No | none | No | Primary key. Foreign key to Illustration.IllustrationID. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductModelIllustration
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ProductModelIllustration_ProductModelID_IllustrationID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductModelID, IllustrationID |
Foreign Keys in ProductModelIllustration
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductModelIllustration_Illustration_IllustrationID | IllustrationID | Production.Illustration (IllustrationID) | Foreign key constraint referencing Illustration.IllustrationID. |
FK_ProductModelIllustration_ProductModel_ProductModelID | ProductModelID | Production.ProductModel (ProductModelID) | Foreign key constraint referencing ProductModel.ProductModelID. |
Production.ProductModelProductDescriptionCulture (table)
Cross-reference table mapping product descriptions and the language the description is written in.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductModelID | int | 10,0 | No | none | No | Primary key. Foreign key to ProductModel.ProductModelID. |
ProductDescriptionID | int | 10,0 | No | none | No | Primary key. Foreign key to ProductDescription.ProductDescriptionID. |
CultureID | nchar | 6 | No | none | No | Culture identification number. Foreign key to Culture.CultureID. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductModelProductDescriptionCulture
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductModelID, ProductDescriptionID, CultureID |
Foreign Keys in ProductModelProductDescriptionCulture
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductModelProductDescriptionCulture_Culture_CultureID | CultureID | Production.Culture (CultureID) | Foreign key constraint referencing Culture.CultureID. |
FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID | ProductDescriptionID | Production.ProductDescription (ProductDescriptionID) | Foreign key constraint referencing ProductDescription.ProductDescriptionID. |
FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID | ProductModelID | Production.ProductModel (ProductModelID) | Foreign key constraint referencing ProductModel.ProductModelID. |
Production.ProductPhoto (table)
Product images.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductPhotoID | int (identity) | 10,0 | No | none | No | Primary key for ProductPhoto records. |
ThumbNailPhoto | varbinary | | Yes | none | No | Small image of the product. |
ThumbnailPhotoFileName | nvarchar | 50 | Yes | none | No | Small image file name. |
LargePhoto | varbinary | | Yes | none | No | Large image of the product. |
LargePhotoFileName | nvarchar | 50 | Yes | none | No | Large image file name. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductPhoto
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ProductPhoto_ProductPhotoID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductPhotoID |
Production.ProductProductPhoto (table)
Cross-reference table mapping products and product photos.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
ProductPhotoID | int | 10,0 | No | none | No | Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. |
Primary | bit | | No | ((0)) | No | 0 = Photo is not the principal image. 1 = Photo is the principal image. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductProductPhoto
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ProductProductPhoto_ProductID_ProductPhotoID | Nonclustered index created by a primary key constraint. | Yes | Yes | NONCLUSTERED | ProductID, ProductPhotoID |
Foreign Keys in ProductProductPhoto
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductProductPhoto_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
FK_ProductProductPhoto_ProductPhoto_ProductPhotoID | ProductPhotoID | Production.ProductPhoto (ProductPhotoID) | Foreign key constraint referencing ProductPhoto.ProductPhotoID. |
Production.ProductReview (table)
Customer reviews of products they have purchased.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductReviewID | int (identity) | 10,0 | No | none | No | Primary key for ProductReview records. |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
ReviewerName | nvarchar | 50 | No | none | No | Name of the reviewer. |
ReviewDate | datetime | | No | (getdate()) | No | Date review was submitted. |
EmailAddress | nvarchar | 50 | No | none | No | Reviewer's e-mail address. |
Rating | int | 10,0 | No | none | No | Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. |
Comments | nvarchar | 3850 | Yes | none | No | Reviewer's comments |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductReview
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_ProductReview_ProductID_Name | Nonclustered index. | No | No | NONCLUSTERED | Comments, ProductID, ReviewerName |
PK_ProductReview_ProductReviewID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductReviewID |
Foreign Keys in ProductReview
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductReview_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
Production.ProductSubcategory (table)
Product subcategories. See ProductCategory table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductSubcategoryID | int (identity) | 10,0 | No | none | No | Primary key for ProductSubcategory records. |
ProductCategoryID | int | 10,0 | No | none | No | Product category identification number. Foreign key to ProductCategory.ProductCategoryID. |
Name | nvarchar | 50 | No | none | No | Subcategory description. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductSubcategory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_ProductSubcategory_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_ProductSubcategory_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_ProductSubcategory_ProductSubcategoryID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductSubcategoryID |
Foreign Keys in ProductSubcategory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductSubcategory_ProductCategory_ProductCategoryID | ProductCategoryID | Production.ProductCategory (ProductCategoryID) | Foreign key constraint referencing ProductCategory.ProductCategoryID. |
Production.ScrapReason (table)
Manufacturing failure reasons lookup table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ScrapReasonID | smallint (identity) | 5,0 | No | none | No | Primary key for ScrapReason records. |
Name | nvarchar | 50 | No | none | No | Failure description. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ScrapReason
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_ScrapReason_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
PK_ScrapReason_ScrapReasonID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ScrapReasonID |
Production.TransactionHistory (table)
Record of each purchase order, sales order, or work order transaction year to date.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
TransactionID | int (identity) | 10,0 | No | none | No | Primary key for TransactionHistory records. |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
ReferenceOrderID | int | 10,0 | No | none | No | Purchase order, sales order, or work order identification number. |
ReferenceOrderLineID | int | 10,0 | No | ((0)) | No | Line number associated with the purchase order, sales order, or work order. |
TransactionDate | datetime | | No | (getdate()) | No | Date and time of the transaction. |
TransactionType | nchar | 1 | No | none | No | W = WorkOrder, S = SalesOrder, P = PurchaseOrder |
Quantity | int | 10,0 | No | none | No | Product quantity. |
ActualCost | money | 19,4 | No | none | No | Product cost. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on TransactionHistory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_TransactionHistory_ProductID | Nonclustered index. | No | No | NONCLUSTERED | ProductID |
IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID | Nonclustered index. | No | No | NONCLUSTERED | ReferenceOrderID, ReferenceOrderLineID |
PK_TransactionHistory_TransactionID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | TransactionID |
Foreign Keys in TransactionHistory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_TransactionHistory_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
Production.TransactionHistoryArchive (table)
Transactions for previous years.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
TransactionID | int | 10,0 | No | none | No | Primary key for TransactionHistoryArchive records. |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
ReferenceOrderID | int | 10,0 | No | none | No | Purchase order, sales order, or work order identification number. |
ReferenceOrderLineID | int | 10,0 | No | ((0)) | No | Line number associated with the purchase order, sales order, or work order. |
TransactionDate | datetime | | No | (getdate()) | No | Date and time of the transaction. |
TransactionType | nchar | 1 | No | none | No | W = Work Order, S = Sales Order, P = Purchase Order |
Quantity | int | 10,0 | No | none | No | Product quantity. |
ActualCost | money | 19,4 | No | none | No | Product cost. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on TransactionHistoryArchive
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_TransactionHistoryArchive_ProductID | Nonclustered index. | No | No | NONCLUSTERED | ProductID |
IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID | Nonclustered index. | No | No | NONCLUSTERED | ReferenceOrderID, ReferenceOrderLineID |
PK_TransactionHistoryArchive_TransactionID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | TransactionID |
Production.UnitMeasure (table)
Unit of measure lookup table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
UnitMeasureCode | nchar | 3 | No | none | No | Primary key. |
Name | nvarchar | 50 | No | none | No | Unit of measure description. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on UnitMeasure
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_UnitMeasure_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
PK_UnitMeasure_UnitMeasureCode | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | UnitMeasureCode |
Production.WorkOrder (table)
Manufacturing work orders.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
WorkOrderID | int (identity) | 10,0 | No | none | No | Primary key for WorkOrder records. |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
OrderQty | int | 10,0 | No | none | No | Product quantity to build. |
StockedQty | int | 10,0 | No | none | Yes | Quantity built and put in inventory. |
ScrappedQty | smallint | 5,0 | No | none | No | Quantity that failed inspection. |
StartDate | datetime | | No | none | No | Work order start date. |
EndDate | datetime | | Yes | none | No | Work order end date. |
DueDate | datetime | | No | none | No | Work order due date. |
ScrapReasonID | smallint | 5,0 | Yes | none | No | Reason for inspection failure. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on WorkOrder
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_WorkOrder_ProductID | Nonclustered index. | No | No | NONCLUSTERED | ProductID |
IX_WorkOrder_ScrapReasonID | Nonclustered index. | No | No | NONCLUSTERED | ScrapReasonID |
PK_WorkOrder_WorkOrderID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | WorkOrderID |
Foreign Keys in WorkOrder
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_WorkOrder_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
FK_WorkOrder_ScrapReason_ScrapReasonID | ScrapReasonID | Production.ScrapReason (ScrapReasonID) | Foreign key constraint referencing ScrapReason.ScrapReasonID. |
Production.WorkOrderRouting (table)
Work order details.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
WorkOrderID | int | 10,0 | No | none | No | Primary key. Foreign key to WorkOrder.WorkOrderID. |
ProductID | int | 10,0 | No | none | No | Primary key. Foreign key to Product.ProductID. |
OperationSequence | smallint | 5,0 | No | none | No | Primary key. Indicates the manufacturing process sequence. |
LocationID | smallint | 5,0 | No | none | No | Manufacturing location where the part is processed. Foreign key to Location.LocationID. |
ScheduledStartDate | datetime | | No | none | No | Planned manufacturing start date. |
ScheduledEndDate | datetime | | No | none | No | Planned manufacturing end date. |
ActualStartDate | datetime | | Yes | none | No | Actual start date. |
ActualEndDate | datetime | | Yes | none | No | Actual end date. |
ActualResourceHrs | decimal | 9,4 | Yes | none | No | Number of manufacturing hours used. |
PlannedCost | money | 19,4 | No | none | No | Estimated manufacturing cost. |
ActualCost | money | 19,4 | Yes | none | No | Actual manufacturing cost. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on WorkOrderRouting
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_WorkOrderRouting_ProductID | Nonclustered index. | No | No | NONCLUSTERED | ProductID |
PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | WorkOrderID, ProductID, OperationSequence |
Foreign Keys in WorkOrderRouting
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_WorkOrderRouting_Location_LocationID | LocationID | Production.Location (LocationID) | Foreign key constraint referencing Location.LocationID. |
FK_WorkOrderRouting_WorkOrder_WorkOrderID | WorkOrderID | Production.WorkOrder (WorkOrderID) | Foreign key constraint referencing WorkOrder.WorkOrderID. |
Production.vProductAndDescription (view)
Product names and descriptions. Product descriptions are provided in multiple languages.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
ProductID | int | 10,0 | No | none | No |
Name | nvarchar | 50 | No | none | No |
ProductModel | nvarchar | 50 | No | none | No |
CultureID | nchar | 6 | No | none | No |
Description | nvarchar | 400 | No | none | No |
Indexes on vProductAndDescription
Index Name | Description | Is Unique | Index Type | Columns |
IX_vProductAndDescription | Clustered index on the view vProductAndDescription. | Yes | CLUSTERED | CultureID, ProductID |
Production.vProductModelCatalogDescription (view)
Displays the content from each element in the xml column CatalogDescription for each product in the Production.ProductModel table that has catalog data.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
ProductModelID | int (identity) | 10,0 | No | none | No |
Name | nvarchar | 50 | No | none | No |
Summary | nvarchar | | Yes | none | No |
Manufacturer | nvarchar | | Yes | none | No |
Copyright | nvarchar | 30 | Yes | none | No |
ProductURL | nvarchar | 256 | Yes | none | No |
WarrantyPeriod | nvarchar | 256 | Yes | none | No |
WarrantyDescription | nvarchar | 256 | Yes | none | No |
NoOfYears | nvarchar | 256 | Yes | none | No |
MaintenanceDescription | nvarchar | 256 | Yes | none | No |
Wheel | nvarchar | 256 | Yes | none | No |
Saddle | nvarchar | 256 | Yes | none | No |
Pedal | nvarchar | 256 | Yes | none | No |
BikeFrame | nvarchar | | Yes | none | No |
Crankset | nvarchar | 256 | Yes | none | No |
PictureAngle | nvarchar | 256 | Yes | none | No |
PictureSize | nvarchar | 256 | Yes | none | No |
ProductPhotoID | nvarchar | 256 | Yes | none | No |
Material | nvarchar | 256 | Yes | none | No |
Color | nvarchar | 256 | Yes | none | No |
ProductLine | nvarchar | 256 | Yes | none | No |
Style | nvarchar | 256 | Yes | none | No |
RiderExperience | nvarchar | 1024 | Yes | none | No |
rowguid | uniqueidentifier | | No | none | No |
ModifiedDate | datetime | | No | none | No |
Production.vProductModelInstructions (view)
Displays the content from each element in the xml column Instructions for each product in the Production.ProductModel table that has manufacturing instructions.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
ProductModelID | int (identity) | 10,0 | No | none | No |
Name | nvarchar | 50 | No | none | No |
Instructions | nvarchar | | Yes | none | No |
LocationID | int | 10,0 | Yes | none | No |
SetupHours | decimal | 9,4 | Yes | none | No |
MachineHours | decimal | 9,4 | Yes | none | No |
LaborHours | decimal | 9,4 | Yes | none | No |
LotSize | int | 10,0 | Yes | none | No |
Step | nvarchar | 1024 | Yes | none | No |
rowguid | uniqueidentifier | | No | none | No |
ModifiedDate | datetime | | No | none | No |
Purchasing (schema)
Contains objects related to vendors and purchase orders.
Object Type | Count |
Tables | 7 |
Views | 1 |
Stored procedures | 0 |
Scalar functions | 0 |
Table functions | 0 |
Purchasing.ProductVendor (table)
Cross-reference table mapping vendors with the products they supply.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ProductID | int | 10,0 | No | none | No | Primary key. Foreign key to Product.ProductID. |
VendorID | int | 10,0 | No | none | No | Primary key. Foreign key to Vendor.VendorID. |
AverageLeadTime | int | 10,0 | No | none | No | The average span of time (in days) between placing an order with the vendor and receiving the purchased product. |
StandardPrice | money | 19,4 | No | none | No | The vendor's usual selling price. |
LastReceiptCost | money | 19,4 | Yes | none | No | The selling price when last purchased. |
LastReceiptDate | datetime | | Yes | none | No | Date the product was last received by the vendor. |
MinOrderQty | int | 10,0 | No | none | No | The maximum quantity that should be ordered. |
MaxOrderQty | int | 10,0 | No | none | No | The minimum quantity that should be ordered. |
OnOrderQty | int | 10,0 | Yes | none | No | The quantity currently on order. |
UnitMeasureCode | nchar | 3 | No | none | No | The product's unit of measure. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ProductVendor
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_ProductVendor_UnitMeasureCode | Nonclustered index. | No | No | NONCLUSTERED | UnitMeasureCode |
IX_ProductVendor_VendorID | Nonclustered index. | No | No | NONCLUSTERED | VendorID |
PK_ProductVendor_ProductID_VendorID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ProductID, VendorID |
Foreign Keys in ProductVendor
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ProductVendor_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
FK_ProductVendor_UnitMeasure_UnitMeasureCode | UnitMeasureCode | Production.UnitMeasure (UnitMeasureCode) | Foreign key constraint referencing UnitMeasure.UnitMeasureCode. |
FK_ProductVendor_Vendor_VendorID | VendorID | Purchasing.Vendor (VendorID) | Foreign key constraint referencing Vendor.VendorID. |
Purchasing.PurchaseOrderDetail (table)
Individual products associated with a specific purchase order. See PurchaseOrderHeader.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
PurchaseOrderID | int | 10,0 | No | none | No | Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. |
PurchaseOrderDetailID | int (identity) | 10,0 | No | none | No | Primary key. One line number per purchased product. |
DueDate | datetime | | No | none | No | Date the product is expected to be received. |
OrderQty | smallint | 5,0 | No | none | No | Quantity ordered. |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
UnitPrice | money | 19,4 | No | none | No | Vendor's selling price of a single product. |
LineTotal | money | 19,4 | No | none | Yes | Per product subtotal. Computed as OrderQty * UnitPrice. |
ReceivedQty | decimal | 8,2 | No | none | No | Quantity actually received from the vendor. |
RejectedQty | decimal | 8,2 | No | none | No | Quantity rejected during inspection. |
StockedQty | decimal | 9,2 | No | none | Yes | Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on PurchaseOrderDetail
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_PurchaseOrderDetail_ProductID | Nonclustered index. | No | No | NONCLUSTERED | ProductID |
PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | PurchaseOrderID, PurchaseOrderDetailID |
Foreign Keys in PurchaseOrderDetail
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_PurchaseOrderDetail_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID | PurchaseOrderID | Purchasing.PurchaseOrderHeader (PurchaseOrderID) | Foreign key constraint referencing PurchaseOrderHeader.PurchaseOrderID. |
Purchasing.PurchaseOrderHeader (table)
General purchase order information. See PurchaseOrderDetail.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
PurchaseOrderID | int (identity) | 10,0 | No | none | No | Primary key. |
RevisionNumber | tinyint | 3,0 | No | ((0)) | No | Incremental number to track changes to the purchase order over time. |
Status | tinyint | 3,0 | No | ((1)) | No | Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete |
EmployeeID | int | 10,0 | No | none | No | Employee who created the purchase order. Foreign key to Employee.EmployeeID. |
VendorID | int | 10,0 | No | none | No | Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID. |
ShipMethodID | int | 10,0 | No | none | No | Shipping method. Foreign key to ShipMethod.ShipMethodID. |
OrderDate | datetime | | No | (getdate()) | No | Purchase order creation date. |
ShipDate | datetime | | Yes | none | No | Estimated shipment date from the vendor. |
SubTotal | money | 19,4 | No | ((0.00)) | No | Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. |
TaxAmt | money | 19,4 | No | ((0.00)) | No | Tax amount. |
Freight | money | 19,4 | No | ((0.00)) | No | Shipping cost. |
TotalDue | money | 19,4 | No | none | Yes | Total due to vendor. Computed as Subtotal + TaxAmt + Freight. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on PurchaseOrderHeader
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_PurchaseOrderHeader_EmployeeID | Nonclustered index. | No | No | NONCLUSTERED | EmployeeID |
IX_PurchaseOrderHeader_VendorID | Nonclustered index. | No | No | NONCLUSTERED | VendorID |
PK_PurchaseOrderHeader_PurchaseOrderID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | PurchaseOrderID |
Foreign Keys in PurchaseOrderHeader
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_PurchaseOrderHeader_Employee_EmployeeID | EmployeeID | HumanResources.Employee (EmployeeID) | Foreign key constraint referencing Employee.EmployeeID. |
FK_PurchaseOrderHeader_ShipMethod_ShipMethodID | ShipMethodID | Purchasing.ShipMethod (ShipMethodID) | Foreign key constraint referencing ShipMethod.ShipMethodID. |
FK_PurchaseOrderHeader_Vendor_VendorID | VendorID | Purchasing.Vendor (VendorID) | Foreign key constraint referencing Vendor.VendorID. |
Purchasing.ShipMethod (table)
Shipping company lookup table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ShipMethodID | int (identity) | 10,0 | No | none | No | Primary key for ShipMethod records. |
Name | nvarchar | 50 | No | none | No | Shipping company name. |
ShipBase | money | 19,4 | No | ((0.00)) | No | Minimum shipping charge. |
ShipRate | money | 19,4 | No | ((0.00)) | No | Shipping charge per pound. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ShipMethod
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_ShipMethod_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_ShipMethod_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_ShipMethod_ShipMethodID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ShipMethodID |
Purchasing.Vendor (table)
Companies from whom Adventure Works Cycles purchases parts or other goods.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
VendorID | int (identity) | 10,0 | No | none | No | Primary key for Vendor records. |
AccountNumber | nvarchar | 15 | No | none | No | Vendor account (identification) number. |
Name | nvarchar | 50 | No | none | No | Company name. |
CreditRating | tinyint | 3,0 | No | none | No | 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average |
PreferredVendorStatus | bit | | No | ((1)) | No | 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. |
ActiveFlag | bit | | No | ((1)) | No | 0 = Vendor no longer used. 1 = Vendor is actively used. |
PurchasingWebServiceURL | nvarchar | 1024 | Yes | none | No | Vendor URL. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Vendor
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Vendor_AccountNumber | Unique nonclustered index. | No | Yes | NONCLUSTERED | AccountNumber |
PK_Vendor_VendorID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | VendorID |
Purchasing.VendorAddress (table)
Cross-reference mapping vendors and addresses.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
VendorID | int | 10,0 | No | none | No | Primary key. Foreign key to Vendor.VendorID. |
AddressID | int | 10,0 | No | none | No | Primary key. Foreign key to Address.AddressID. |
AddressTypeID | int | 10,0 | No | none | No | Address type. Foreign key to AddressType.AddressTypeID. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on VendorAddress
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_VendorAddress_AddressID | Nonclustered index. | No | No | NONCLUSTERED | AddressID |
PK_VendorAddress_VendorID_AddressID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | VendorID, AddressID |
Foreign Keys in VendorAddress
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_VendorAddress_Address_AddressID | AddressID | Person.Address (AddressID) | Foreign key constraint referencing Address.AddressID. |
FK_VendorAddress_AddressType_AddressTypeID | AddressTypeID | Person.AddressType (AddressTypeID) | Foreign key constraint referencing AddressType.AddressTypeID. |
FK_VendorAddress_Vendor_VendorID | VendorID | Purchasing.Vendor (VendorID) | Foreign key constraint referencing Vendor.VendorID. |
Purchasing.VendorContact (table)
Cross-reference table mapping vendors and their employees.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
VendorID | int | 10,0 | No | none | No | Primary key. |
ContactID | int | 10,0 | No | none | No | Contact (Vendor employee) identification number. Foreign key to Contact.ContactID. |
ContactTypeID | int | 10,0 | No | none | No | Contact type such as sales manager, or sales agent. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on VendorContact
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_VendorContact_ContactID | Nonclustered index. | No | No | NONCLUSTERED | ContactID |
IX_VendorContact_ContactTypeID | Nonclustered index. | No | No | NONCLUSTERED | ContactTypeID |
PK_VendorContact_VendorID_ContactID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | VendorID, ContactID |
Foreign Keys in VendorContact
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_VendorContact_Contact_ContactID | ContactID | Person.Contact (ContactID) | Foreign key constraint referencing Contact.ContactID. |
FK_VendorContact_ContactType_ContactTypeID | ContactTypeID | Person.ContactType (ContactTypeID) | Foreign key constraint referencing ContactType.ContactTypeID. |
FK_VendorContact_Vendor_VendorID | VendorID | Purchasing.Vendor (VendorID) | Foreign key constraint referencing Vendor.VendorID. |
Purchasing.vVendor (view)
Vendor (company) names and addresses and the names of vendor employees to contact.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
VendorID | int | 10,0 | No | none | No |
Name | nvarchar | 50 | No | none | No |
ContactType | nvarchar | 50 | No | none | No |
Title | nvarchar | 8 | Yes | none | No |
FirstName | nvarchar | 50 | No | none | No |
MiddleName | nvarchar | 50 | Yes | none | No |
LastName | nvarchar | 50 | No | none | No |
Suffix | nvarchar | 10 | Yes | none | No |
Phone | nvarchar | 25 | Yes | none | No |
EmailAddress | nvarchar | 50 | Yes | none | No |
EmailPromotion | int | 10,0 | No | none | No |
AddressLine1 | nvarchar | 60 | No | none | No |
AddressLine2 | nvarchar | 60 | Yes | none | No |
City | nvarchar | 30 | No | none | No |
StateProvinceName | nvarchar | 50 | No | none | No |
PostalCode | nvarchar | 15 | No | none | No |
CountryRegionName | nvarchar | 50 | No | none | No |
Sales (schema)
Contains objects related to customers, sales orders, and sales territories.
Object Type | Count |
Tables | 22 |
Views | 5 |
Stored procedures | 0 |
Scalar functions | 0 |
Table functions | 0 |
Sales.ContactCreditCard (table)
Cross-reference table mapping customers in the Contact table to their credit card information in the CreditCard table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ContactID | int | 10,0 | No | none | No | Customer identification number. Foreign key to Contact.ContactID. |
CreditCardID | int | 10,0 | No | none | No | Credit card identification number. Foreign key to CreditCard.CreditCardID. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ContactCreditCard
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_ContactCreditCard_ContactID_CreditCardID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ContactID, CreditCardID |
Foreign Keys in ContactCreditCard
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ContactCreditCard_Contact_ContactID | ContactID | Person.Contact (ContactID) | Foreign key constraint referencing Contact.ContactID. |
FK_ContactCreditCard_CreditCard_CreditCardID | CreditCardID | Sales.CreditCard (CreditCardID) | Foreign key constraint referencing CreditCard.CreditCardID. |
Sales.CountryRegionCurrency (table)
Cross-reference table mapping ISO currency codes to a country or region.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CountryRegionCode | nvarchar | 3 | No | none | No | ISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode. |
CurrencyCode | nchar | 3 | No | none | No | ISO standard currency code. Foreign key to Currency.CurrencyCode. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on CountryRegionCurrency
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_CountryRegionCurrency_CurrencyCode | Nonclustered index. | No | No | NONCLUSTERED | CurrencyCode |
PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CountryRegionCode, CurrencyCode |
Foreign Keys in CountryRegionCurrency
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_CountryRegionCurrency_CountryRegion_CountryRegionCode | CountryRegionCode | Person.CountryRegion (CountryRegionCode) | Foreign key constraint referencing CountryRegion.CountryRegionCode. |
FK_CountryRegionCurrency_Currency_CurrencyCode | CurrencyCode | Sales.Currency (CurrencyCode) | Foreign key constraint referencing Currency.CurrencyCode. |
Sales.CreditCard (table)
Customer credit card information.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CreditCardID | int (identity) | 10,0 | No | none | No | Primary key for CreditCard records. |
CardType | nvarchar | 50 | No | none | No | Credit card name. |
CardNumber | nvarchar | 25 | No | none | No | Credit card number. |
ExpMonth | tinyint | 3,0 | No | none | No | Credit card expiration month. |
ExpYear | smallint | 5,0 | No | none | No | Credit card expiration year. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on CreditCard
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_CreditCard_CardNumber | Unique nonclustered index. | No | Yes | NONCLUSTERED | CardNumber |
PK_CreditCard_CreditCardID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CreditCardID |
Sales.Currency (table)
Lookup table containing standard ISO currencies.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CurrencyCode | nchar | 3 | No | none | No | The ISO code for the Currency. |
Name | nvarchar | 50 | No | none | No | Currency name. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Currency
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Currency_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
PK_Currency_CurrencyCode | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CurrencyCode |
Sales.CurrencyRate (table)
Currency exchange rates.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CurrencyRateID | int (identity) | 10,0 | No | none | No | Primary key for CurrencyRate records. |
CurrencyRateDate | datetime | | No | none | No | Date and time the exchange rate was obtained. |
FromCurrencyCode | nchar | 3 | No | none | No | Exchange rate was converted from this currency code. |
ToCurrencyCode | nchar | 3 | No | none | No | Exchange rate was converted to this currency code. |
AverageRate | money | 19,4 | No | none | No | Average exchange rate for the day. |
EndOfDayRate | money | 19,4 | No | none | No | Final exchange rate for the day. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on CurrencyRate
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode | Unique nonclustered index. | No | Yes | NONCLUSTERED | CurrencyRateDate, FromCurrencyCode, ToCurrencyCode |
PK_CurrencyRate_CurrencyRateID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CurrencyRateID |
Foreign Keys in CurrencyRate
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_CurrencyRate_Currency_FromCurrencyCode | FromCurrencyCode | Sales.Currency (CurrencyCode) | Foreign key constraint referencing Currency.FromCurrencyCode. |
FK_CurrencyRate_Currency_ToCurrencyCode | ToCurrencyCode | Sales.Currency (CurrencyCode) | Foreign key constraint referencing Currency.ToCurrencyCode. |
Sales.Customer (table)
Current customer information. Also see the Individual and Store tables.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CustomerID | int (identity) | 10,0 | No | none | No | Primary key for Customer records. |
TerritoryID | int | 10,0 | Yes | none | No | ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. |
AccountNumber | varchar | 10 | No | none | Yes | Unique number identifying the customer assigned by the accounting system. |
CustomerType | nchar | 1 | No | none | No | Customer type: I = Individual, S = Store |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Customer
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Customer_AccountNumber | Unique nonclustered index. | No | Yes | NONCLUSTERED | AccountNumber |
AK_Customer_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
IX_Customer_TerritoryID | Nonclustered index. | No | No | NONCLUSTERED | TerritoryID |
PK_Customer_CustomerID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CustomerID |
Foreign Keys in Customer
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_Customer_SalesTerritory_TerritoryID | TerritoryID | Sales.SalesTerritory (TerritoryID) | Foreign key constraint referencing SalesTerritory.TerritoryID. |
Sales.CustomerAddress (table)
Cross-reference table mapping customers to their address(es).
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CustomerID | int | 10,0 | No | none | No | Primary key. Foreign key to Customer.CustomerID. |
AddressID | int | 10,0 | No | none | No | Primary key. Foreign key to Address.AddressID. |
AddressTypeID | int | 10,0 | No | none | No | Address type. Foreign key to AddressType.AddressTypeID. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on CustomerAddress
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_CustomerAddress_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_CustomerAddress_CustomerID_AddressID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CustomerID, AddressID |
Foreign Keys in CustomerAddress
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_CustomerAddress_Address_AddressID | AddressID | Person.Address (AddressID) | Foreign key constraint referencing Address.AddressID. |
FK_CustomerAddress_AddressType_AddressTypeID | AddressTypeID | Person.AddressType (AddressTypeID) | Foreign key constraint referencing AddressType.AddressTypeID. |
FK_CustomerAddress_Customer_CustomerID | CustomerID | Sales.Customer (CustomerID) | Foreign key constraint referencing Customer.CustomerID. |
Sales.Individual (table)
Demographic data about customers that purchase Adventure Works products online.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CustomerID | int | 10,0 | No | none | No | Unique customer identification number. Foreign key to Customer.CustomerID. |
ContactID | int | 10,0 | No | none | No | Identifies the customer in the Contact table. Foreign key to Contact.ContactID. |
Demographics | xml | | Yes | none | No | Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Individual
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_Individual_CustomerID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CustomerID |
PXML_Individual_Demographics | Primary XML index. | No | No | XML | Demographics |
XMLPATH_Individual_Demographics | Secondary XML index for path. | No | No | XML | Demographics |
XMLPROPERTY_Individual_Demographics | Secondary XML index for property. | No | No | XML | Demographics |
XMLVALUE_Individual_Demographics | Secondary XML index for value. | No | No | XML | Demographics |
Foreign Keys in Individual
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_Individual_Contact_ContactID | ContactID | Person.Contact (ContactID) | Foreign key constraint referencing Contact.ContactID. |
FK_Individual_Customer_CustomerID | CustomerID | Sales.Customer (CustomerID) | Foreign key constraint referencing Customer.CustomerID. |
Sales.SalesOrderDetail (table)
Individual products associated with a specific sales order. See SalesOrderHeader.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SalesOrderID | int | 10,0 | No | none | No | Primary key. Foreign key to SalesOrderHeader.SalesOrderID. |
SalesOrderDetailID | int (identity) | 10,0 | No | none | No | Primary key. One incremental unique number per product sold. |
CarrierTrackingNumber | nvarchar | 25 | Yes | none | No | Shipment tracking number supplied by the shipper. |
OrderQty | smallint | 5,0 | No | none | No | Quantity ordered per product. |
ProductID | int | 10,0 | No | none | No | Product sold to customer. Foreign key to Product.ProductID. |
SpecialOfferID | int | 10,0 | No | none | No | Promotional code. Foreign key to SpecialOffer.SpecialOfferID. |
UnitPrice | money | 19,4 | No | none | No | Selling price of a single product. |
UnitPriceDiscount | money | 19,4 | No | ((0.0)) | No | Discount amount. |
LineTotal | numeric | 38,6 | No | none | Yes | Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesOrderDetail
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SalesOrderDetail_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
IX_SalesOrderDetail_ProductID | Nonclustered index. | No | No | NONCLUSTERED | ProductID |
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SalesOrderID, SalesOrderDetailID |
Foreign Keys in SalesOrderDetail
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID | SalesOrderID | Sales.SalesOrderHeader (SalesOrderID) | Foreign key constraint referencing SalesOrderHeader.PurchaseOrderID. |
FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID | SpecialOfferID, ProductID | Sales.SpecialOfferProduct (SpecialOfferID, ProductID) | Foreign key constraint referencing SpecialOfferProduct.SpecialOfferIDProductID. |
Sales.SalesOrderHeader (table)
General sales order information.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SalesOrderID | int (identity) | 10,0 | No | none | No | Primary key. |
RevisionNumber | tinyint | 3,0 | No | ((0)) | No | Incremental number to track changes to the sales order over time. |
OrderDate | datetime | | No | (getdate()) | No | Dates the sales order was created. |
DueDate | datetime | | No | none | No | Date the order is due to the customer. |
ShipDate | datetime | | Yes | none | No | Date the order was shipped to the customer. |
Status | tinyint | 3,0 | No | ((1)) | No | Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled |
OnlineOrderFlag | bit | | No | ((1)) | No | 0 = Order placed by sales person. 1 = Order placed online by customer. |
SalesOrderNumber | nvarchar | 25 | No | none | Yes | Unique sales order identification number. |
PurchaseOrderNumber | nvarchar | 25 | Yes | none | No | Customer purchase order number reference. |
AccountNumber | nvarchar | 15 | Yes | none | No | Financial accounting number reference. |
CustomerID | int | 10,0 | No | none | No | Customer identification number. Foreign key to Customer.CustomerID. |
ContactID | int | 10,0 | No | none | No | Customer contact identification number. Foreign key to Contact.ContactID. |
SalesPersonID | int | 10,0 | Yes | none | No | Sales person who created the sales order. Foreign key to SalesPerson.SalePersonID. |
TerritoryID | int | 10,0 | Yes | none | No | Territory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID. |
BillToAddressID | int | 10,0 | No | none | No | Customer billing address. Foreign key to Address.AddressID. |
ShipToAddressID | int | 10,0 | No | none | No | Customer shipping address. Foreign key to Address.AddressID. |
ShipMethodID | int | 10,0 | No | none | No | Shipping method. Foreign key to ShipMethod.ShipMethodID. |
CreditCardID | int | 10,0 | Yes | none | No | Credit card identification number. Foreign key to CreditCard.CreditCardID. |
CreditCardApprovalCode | varchar | 15 | Yes | none | No | Approval code provided by the credit card company. |
CurrencyRateID | int | 10,0 | Yes | none | No | Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID. |
SubTotal | money | 19,4 | No | ((0.00)) | No | Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. |
TaxAmt | money | 19,4 | No | ((0.00)) | No | Tax amount. |
Freight | money | 19,4 | No | ((0.00)) | No | Shipping cost. |
TotalDue | money | 19,4 | No | none | Yes | Total due from customer. Computed as Subtotal + TaxAmt + Freight. |
Comment | nvarchar | 128 | Yes | none | No | Sales representative comments. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesOrderHeader
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SalesOrderHeader_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
AK_SalesOrderHeader_SalesOrderNumber | Unique nonclustered index. | No | Yes | NONCLUSTERED | SalesOrderNumber |
IX_SalesOrderHeader_CustomerID | Nonclustered index. | No | No | NONCLUSTERED | CustomerID |
IX_SalesOrderHeader_SalesPersonID | Nonclustered index. | No | No | NONCLUSTERED | SalesPersonID |
PK_SalesOrderHeader_SalesOrderID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SalesOrderID |
Foreign Keys in SalesOrderHeader
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_SalesOrderHeader_Address_BillToAddressID | BillToAddressID | Person.Address (AddressID) | Foreign key constraint referencing Address.AddressID. |
FK_SalesOrderHeader_Address_ShipToAddressID | ShipToAddressID | Person.Address (AddressID) | Foreign key constraint referencing Address.AddressID. |
FK_SalesOrderHeader_Contact_ContactID | ContactID | Person.Contact (ContactID) | Foreign key constraint referencing Contact.ContactID. |
FK_SalesOrderHeader_CreditCard_CreditCardID | CreditCardID | Sales.CreditCard (CreditCardID) | Foreign key constraint referencing CreditCard.CreditCardID. |
FK_SalesOrderHeader_CurrencyRate_CurrencyRateID | CurrencyRateID | Sales.CurrencyRate (CurrencyRateID) | Foreign key constraint referencing CurrencyRate.CurrencyRateID. |
FK_SalesOrderHeader_Customer_CustomerID | CustomerID | Sales.Customer (CustomerID) | Foreign key constraint referencing Customer.CustomerID. |
FK_SalesOrderHeader_SalesPerson_SalesPersonID | SalesPersonID | Sales.SalesPerson (SalesPersonID) | Foreign key constraint referencing SalesPerson.SalesPersonID. |
FK_SalesOrderHeader_SalesTerritory_TerritoryID | TerritoryID | Sales.SalesTerritory (TerritoryID) | Foreign key constraint referencing SalesTerritory.TerritoryID. |
FK_SalesOrderHeader_ShipMethod_ShipMethodID | ShipMethodID | Purchasing.ShipMethod (ShipMethodID) | Foreign key constraint referencing ShipMethod.ShipMethodID. |
Sales.SalesOrderHeaderSalesReason (table)
Cross-reference table mapping sales orders to sales reason codes.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SalesOrderID | int | 10,0 | No | none | No | Primary key. Foreign key to SalesOrderHeader.SalesOrderID. |
SalesReasonID | int | 10,0 | No | none | No | Primary key. Foreign key to SalesReason.SalesReasonID. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesOrderHeaderSalesReason
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SalesOrderID, SalesReasonID |
Foreign Keys in SalesOrderHeaderSalesReason
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID | SalesOrderID | Sales.SalesOrderHeader (SalesOrderID) | Foreign key constraint referencing SalesOrderHeader.SalesOrderID. |
FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID | SalesReasonID | Sales.SalesReason (SalesReasonID) | Foreign key constraint referencing SalesReason.SalesReasonID. |
Sales.SalesPerson (table)
Sales representative current information.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SalesPersonID | int | 10,0 | No | none | No | Primary key for SalesPerson records. |
TerritoryID | int | 10,0 | Yes | none | No | Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. |
SalesQuota | money | 19,4 | Yes | none | No | Projected yearly sales. |
Bonus | money | 19,4 | No | ((0.00)) | No | Bonus due if quota is met. |
CommissionPct | smallmoney | 10,4 | No | ((0.00)) | No | Commision percent received per sale. |
SalesYTD | money | 19,4 | No | ((0.00)) | No | Sales total year to date. |
SalesLastYear | money | 19,4 | No | ((0.00)) | No | Sales total of previous year. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesPerson
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SalesPerson_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_SalesPerson_SalesPersonID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SalesPersonID |
Foreign Keys in SalesPerson
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_SalesPerson_Employee_SalesPersonID | SalesPersonID | HumanResources.Employee (EmployeeID) | Foreign key constraint referencing Employee.EmployeeID. |
FK_SalesPerson_SalesTerritory_TerritoryID | TerritoryID | Sales.SalesTerritory (TerritoryID) | Foreign key constraint referencing SalesTerritory.TerritoryID. |
Sales.SalesPersonQuotaHistory (table)
Sales performance tracking.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SalesPersonID | int | 10,0 | No | none | No | Sales person identification number. Foreign key to SalesPerson.SalesPersonID. |
QuotaDate | datetime | | No | none | No | Sales quota date. |
SalesQuota | money | 19,4 | No | none | No | Sales quota amount. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesPersonQuotaHistory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SalesPersonQuotaHistory_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_SalesPersonQuotaHistory_SalesPersonID_QuotaDate | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SalesPersonID, QuotaDate |
Foreign Keys in SalesPersonQuotaHistory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID | SalesPersonID | Sales.SalesPerson (SalesPersonID) | Foreign key constraint referencing SalesPerson.SalesPersonID. |
Sales.SalesReason (table)
Lookup table of customer purchase reasons.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SalesReasonID | int (identity) | 10,0 | No | none | No | Primary key for SalesReason records. |
Name | nvarchar | 50 | No | none | No | Sales reason description. |
ReasonType | nvarchar | 50 | No | none | No | Category the sales reason belongs to. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesReason
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
PK_SalesReason_SalesReasonID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SalesReasonID |
Sales.SalesTaxRate (table)
Tax rate lookup table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SalesTaxRateID | int (identity) | 10,0 | No | none | No | Primary key for SalesTaxRate records. |
StateProvinceID | int | 10,0 | No | none | No | State, province, or country/region the sales tax applies to. |
TaxType | tinyint | 3,0 | No | none | No | 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. |
TaxRate | smallmoney | 10,4 | No | ((0.00)) | No | Tax rate amount. |
Name | nvarchar | 50 | No | none | No | Tax rate description. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesTaxRate
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SalesTaxRate_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
AK_SalesTaxRate_StateProvinceID_TaxType | Unique nonclustered index. | No | Yes | NONCLUSTERED | StateProvinceID, TaxType |
PK_SalesTaxRate_SalesTaxRateID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SalesTaxRateID |
Foreign Keys in SalesTaxRate
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_SalesTaxRate_StateProvince_StateProvinceID | StateProvinceID | Person.StateProvince (StateProvinceID) | Foreign key constraint referencing StateProvince.StateProvinceID. |
Sales.SalesTerritory (table)
Sales territory lookup table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
TerritoryID | int (identity) | 10,0 | No | none | No | Primary key for SalesTerritory records. |
Name | nvarchar | 50 | No | none | No | Sales territory description |
CountryRegionCode | nvarchar | 3 | No | none | No | ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. |
Group | nvarchar | 50 | No | none | No | Geographic area to which the sales territory belong. |
SalesYTD | money | 19,4 | No | ((0.00)) | No | Sales in the territory year to date. |
SalesLastYear | money | 19,4 | No | ((0.00)) | No | Sales in the territory the previous year. |
CostYTD | money | 19,4 | No | ((0.00)) | No | Business costs in the territory year to date. |
CostLastYear | money | 19,4 | No | ((0.00)) | No | Business costs in the territory the previous year. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesTerritory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SalesTerritory_Name | Unique nonclustered index. | No | Yes | NONCLUSTERED | Name |
AK_SalesTerritory_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_SalesTerritory_TerritoryID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | TerritoryID |
Sales.SalesTerritoryHistory (table)
Sales representative transfers to other sales territories.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SalesPersonID | int | 10,0 | No | none | No | Primary key for SalesTerritoryHistory records. |
TerritoryID | int | 10,0 | No | none | No | Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. |
StartDate | datetime | | No | none | No | Date the sales representive started work in the territory. |
EndDate | datetime | | Yes | none | No | Date the sales representative left work in the territory. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SalesTerritoryHistory
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SalesTerritoryHistory_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_SalesTerritoryHistory_SalesPersonID_StartDate_TerritoryID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SalesPersonID, StartDate, TerritoryID |
Foreign Keys in SalesTerritoryHistory
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_SalesTerritoryHistory_SalesPerson_SalesPersonID | SalesPersonID | Sales.SalesPerson (SalesPersonID) | Foreign key constraint referencing SalesPerson.SalesPersonID. |
FK_SalesTerritoryHistory_SalesTerritory_TerritoryID | TerritoryID | Sales.SalesTerritory (TerritoryID) | Foreign key constraint referencing SalesTerritory.TerritoryID. |
Sales.ShoppingCartItem (table)
Contains online customer orders until the order is submitted or cancelled.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
ShoppingCartItemID | int (identity) | 10,0 | No | none | No | Primary key for ShoppingCartItem records. |
ShoppingCartID | nvarchar | 50 | No | none | No | Shopping cart identification number. |
Quantity | int | 10,0 | No | ((1)) | No | Product quantity ordered. |
ProductID | int | 10,0 | No | none | No | Product ordered. Foreign key to Product.ProductID. |
DateCreated | datetime | | No | (getdate()) | No | Date the time the record was created. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on ShoppingCartItem
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
IX_ShoppingCartItem_ShoppingCartID_ProductID | Nonclustered index. | No | No | NONCLUSTERED | ShoppingCartID, ProductID |
PK_ShoppingCartItem_ShoppingCartItemID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | ShoppingCartItemID |
Foreign Keys in ShoppingCartItem
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_ShoppingCartItem_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
Sales.SpecialOffer (table)
Sale discounts lookup table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SpecialOfferID | int (identity) | 10,0 | No | none | No | Primary key for SpecialOffer records. |
Description | nvarchar | 255 | No | none | No | Discount description. |
DiscountPct | smallmoney | 10,4 | No | ((0.00)) | No | Discount precentage. |
Type | nvarchar | 50 | No | none | No | Discount type category. |
Category | nvarchar | 50 | No | none | No | Group the discount applies to such as Reseller or Customer. |
StartDate | datetime | | No | none | No | Discount start date. |
EndDate | datetime | | No | none | No | Discount end date. |
MinQty | int | 10,0 | No | ((0)) | No | Minimum discount percent allowed. |
MaxQty | int | 10,0 | Yes | none | No | Maximum discount percent allowed. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SpecialOffer
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SpecialOffer_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
PK_SpecialOffer_SpecialOfferID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SpecialOfferID |
Sales.SpecialOfferProduct (table)
Cross-reference table mapping products to special offer discounts.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
SpecialOfferID | int | 10,0 | No | none | No | Primary key for SpecialOfferProduct records. |
ProductID | int | 10,0 | No | none | No | Product identification number. Foreign key to Product.ProductID. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on SpecialOfferProduct
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_SpecialOfferProduct_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
IX_SpecialOfferProduct_ProductID | Nonclustered index. | No | No | NONCLUSTERED | ProductID |
PK_SpecialOfferProduct_SpecialOfferID_ProductID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | SpecialOfferID, ProductID |
Foreign Keys in SpecialOfferProduct
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_SpecialOfferProduct_Product_ProductID | ProductID | Production.Product (ProductID) | Foreign key constraint referencing Product.ProductID. |
FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID | SpecialOfferID | Sales.SpecialOffer (SpecialOfferID) | Foreign key constraint referencing SpecialOffer.SpecialOfferID. |
Sales.Store (table)
Customers (resellers) of Adventure Works products.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CustomerID | int | 10,0 | No | none | No | Primary key. Foreign key to Customer.CustomerID. |
Name | nvarchar | 50 | No | none | No | Name of the store. |
SalesPersonID | int | 10,0 | Yes | none | No | ID of the sales person assigned to the customer. Foreign key to SalesPerson.SalesPersonID. |
Demographics | xml | | Yes | none | No | Demographic informationg about the store such as the number of employees, annual sales and store type. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on Store
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_Store_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
IX_Store_SalesPersonID | Nonclustered index. | No | No | NONCLUSTERED | SalesPersonID |
PK_Store_CustomerID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CustomerID |
PXML_Store_Demographics | Primary XML index. | No | No | XML | Demographics |
Foreign Keys in Store
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_Store_Customer_CustomerID | CustomerID | Sales.Customer (CustomerID) | Foreign key constraint referencing Customer.CustomerID. |
FK_Store_SalesPerson_SalesPersonID | SalesPersonID | Sales.SalesPerson (SalesPersonID) | Foreign key constraint referencing SalesPerson.SalesPersonID |
Sales.StoreContact (table)
Cross-reference table mapping stores and their employees.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed | Description |
CustomerID | int | 10,0 | No | none | No | Store identification number. Foreign key to Customer.CustomerID. |
ContactID | int | 10,0 | No | none | No | Contact (store employee) identification number. Foreign key to Contact.ContactID. |
ContactTypeID | int | 10,0 | No | none | No | Contact type such as owner or purchasing agent. Foreign key to ContactType.ContactTypeID. |
rowguid | uniqueidentifier | | No | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
ModifiedDate | datetime | | No | (getdate()) | No | Date and time the record was last updated. |
Indexes on StoreContact
Index Name | Description | Is Primary Key | Is Unique | Index Type | Columns |
AK_StoreContact_rowguid | Unique nonclustered index. Used to support replication samples. | No | Yes | NONCLUSTERED | rowguid |
IX_StoreContact_ContactID | Nonclustered index. | No | No | NONCLUSTERED | ContactID |
IX_StoreContact_ContactTypeID | Nonclustered index. | No | No | NONCLUSTERED | ContactTypeID |
PK_StoreContact_CustomerID_ContactID | Clustered index created by a primary key constraint. | Yes | Yes | CLUSTERED | CustomerID, ContactID |
Foreign Keys in StoreContact
Foreign Key Name | Columns | References Table (Columns) | Description |
FK_StoreContact_Contact_ContactID | ContactID | Person.Contact (ContactID) | Foreign key constraint referencing Contact.ContactID. |
FK_StoreContact_ContactType_ContactTypeID | ContactTypeID | Person.ContactType (ContactTypeID) | Foreign key constraint referencing ContactType.ContactTypeID. |
FK_StoreContact_Store_CustomerID | CustomerID | Sales.Store (CustomerID) | Foreign key constraint referencing Store.CustomerID. |
Sales.vIndividualCustomer (view)
Individual customers (names and addresses) that purchase Adventure Works Cycles products online.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
CustomerID | int | 10,0 | No | none | No |
Title | nvarchar | 8 | Yes | none | No |
FirstName | nvarchar | 50 | No | none | No |
MiddleName | nvarchar | 50 | Yes | none | No |
LastName | nvarchar | 50 | No | none | No |
Suffix | nvarchar | 10 | Yes | none | No |
Phone | nvarchar | 25 | Yes | none | No |
EmailAddress | nvarchar | 50 | Yes | none | No |
EmailPromotion | int | 10,0 | No | none | No |
AddressType | nvarchar | 50 | No | none | No |
AddressLine1 | nvarchar | 60 | No | none | No |
AddressLine2 | nvarchar | 60 | Yes | none | No |
City | nvarchar | 30 | No | none | No |
StateProvinceName | nvarchar | 50 | No | none | No |
PostalCode | nvarchar | 15 | No | none | No |
CountryRegionName | nvarchar | 50 | No | none | No |
Demographics | xml | | Yes | none | No |
Sales.vIndividualDemographics (view)
Displays the content from each element in the xml column Demographics for each customer in the Sales.Individual table.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
CustomerID | int | 10,0 | No | none | No |
TotalPurchaseYTD | money | 19,4 | Yes | none | No |
DateFirstPurchase | datetime | | Yes | none | No |
BirthDate | datetime | | Yes | none | No |
MaritalStatus | nvarchar | 1 | Yes | none | No |
YearlyIncome | nvarchar | 30 | Yes | none | No |
Gender | nvarchar | 1 | Yes | none | No |
TotalChildren | int | 10,0 | Yes | none | No |
NumberChildrenAtHome | int | 10,0 | Yes | none | No |
Education | nvarchar | 30 | Yes | none | No |
Occupation | nvarchar | 30 | Yes | none | No |
HomeOwnerFlag | bit | | Yes | none | No |
NumberCarsOwned | int | 10,0 | Yes | none | No |
Sales.vSalesPerson (view)
Sales representiatives (names and addresses) and their sales-related information.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
SalesPersonID | int | 10,0 | No | none | No |
Title | nvarchar | 8 | Yes | none | No |
FirstName | nvarchar | 50 | No | none | No |
MiddleName | nvarchar | 50 | Yes | none | No |
LastName | nvarchar | 50 | No | none | No |
Suffix | nvarchar | 10 | Yes | none | No |
JobTitle | nvarchar | 50 | No | none | No |
Phone | nvarchar | 25 | Yes | none | No |
EmailAddress | nvarchar | 50 | Yes | none | No |
EmailPromotion | int | 10,0 | No | none | No |
AddressLine1 | nvarchar | 60 | No | none | No |
AddressLine2 | nvarchar | 60 | Yes | none | No |
City | nvarchar | 30 | No | none | No |
StateProvinceName | nvarchar | 50 | No | none | No |
PostalCode | nvarchar | 15 | No | none | No |
CountryRegionName | nvarchar | 50 | No | none | No |
TerritoryName | nvarchar | 50 | Yes | none | No |
TerritoryGroup | nvarchar | 50 | Yes | none | No |
SalesQuota | money | 19,4 | Yes | none | No |
SalesYTD | money | 19,4 | No | none | No |
SalesLastYear | money | 19,4 | No | none | No |
Sales.vSalesPersonSalesByFiscalYears (view)
Uses PIVOT to return aggregated sales information for each sales representative.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
SalesPersonID | int | 10,0 | Yes | none | No |
FullName | nvarchar | 152 | Yes | none | No |
Title | nvarchar | 50 | No | none | No |
SalesTerritory | nvarchar | 50 | No | none | No |
2002 | money | 19,4 | Yes | none | No |
2003 | money | 19,4 | Yes | none | No |
2004 | money | 19,4 | Yes | none | No |
Sales.vStoreWithDemographics (view)
Stores (names and addresses) that sell Adventure Works Cycles products to consumers.
Column Name | System Data Type | Size | Allow Null | Default | Is Computed |
CustomerID | int | 10,0 | No | none | No |
Name | nvarchar | 50 | No | none | No |
ContactType | nvarchar | 50 | No | none | No |
Title | nvarchar | 8 | Yes | none | No |
FirstName | nvarchar | 50 | No | none | No |
MiddleName | nvarchar | 50 | Yes | none | No |
LastName | nvarchar | 50 | No | none | No |
Suffix | nvarchar | 10 | Yes | none | No |
Phone | nvarchar | 25 | Yes | none | No |
EmailAddress | nvarchar | 50 | Yes | none | No |
EmailPromotion | int | 10,0 | No | none | No |
AddressType | nvarchar | 50 | No | none | No |
AddressLine1 | nvarchar | 60 | No | none | No |
AddressLine2 | nvarchar | 60 | Yes | none | No |
City | nvarchar | 30 | No | none | No |
StateProvinceName | nvarchar | 50 | No | none | No |
PostalCode | nvarchar | 15 | No | none | No |
CountryRegionName | nvarchar | 50 | No | none | No |
AnnualSales | money | 19,4 | Yes | none | No |
AnnualRevenue | money | 19,4 | Yes | none | No |
BankName | nvarchar | 50 | Yes | none | No |
BusinessType | nvarchar | 5 | Yes | none | No |
YearOpened | int | 10,0 | Yes | none | No |
Specialty | nvarchar | 50 | Yes | none | No |
SquareFeet | int | 10,0 | Yes | none | No |
Brands | nvarchar | 30 | Yes | none | No |
Internet | nvarchar | 30 | Yes | none | No |
NumberEmployees | int | 10,0 | Yes | none | No |
Documentation created using SQL Server Database Documentation Generator version 1.3.0
http://jeremykdev.github.io/SqlServerDatabaseDocumentationGenerator/