Database reference - AdventureWorks

AdventureWorks -  tables -  [HumanResources].[Department]

Description

Lookup table containing the departments within the Adventure Works Cycles company. 

Table properties

namevalue
name[HumanResources].[Department]
createdMar 19 2009 9:08PM
modifiedMar 19 2009 9:08PM 
ansi nullson 
quoted identifieron 
row count16
Size of data8 kb
Size of indexes24 kb
Maximum size of a single row410 bytes

Columns

columndatatypelengthbytesdefaultnullsPKFKUQcomputedcomment
DepartmentIDsmallint identity(1,1)52 no  yes    no  Primary key for Department records. 
NameName50200 no      no  Name of the department. 
GroupNameName50200 no      no  Name of the group to which the department belongs. 
ModifiedDatedatetime238(getdate())no      no  Date and time the record was last updated. 

Indexes

namedescriptioncolumncomment
AK_Department_Namenonclustered, unique located on PRIMARYNameUnique nonclustered index. 
PK_Department_DepartmentIDclustered, unique, primary key located on PRIMARYDepartmentIDClustered index created by a primary key constraint. 

Referenced by

name
EmployeeDepartmentHistory

Foreign key graph

DepartmentEmployeeDepartmentHistory

Defaults

default namecolumncomment
DF_Department_ModifiedDateModifiedDateDefault constraint value of GETDATE() 

Dependency graph

DF_Department_ModifiedDateNameDepartmentAK_Department_NamePK_Department_DepartmentID...vEmployeeDepartmentvEmployeeDepartmentHistory

Objects that [HumanResources].[Department] depends on

nameobject typelevel
Nametype1

Objects that depend on [HumanResources].[Department]

nameobject typelevel
vEmployeeDepartmentview1
vEmployeeDepartmentHistoryview1

Sample rows

DepartmentIDNameGroupNameModifiedDate
Engineering  Research and Development  6/1/1998 12:00:00 AM 
Tool Design  Research and Development  6/1/1998 12:00:00 AM 
Sales  Sales and Marketing  6/1/1998 12:00:00 AM 
Marketing  Sales and Marketing  6/1/1998 12:00:00 AM 
Purchasing  Inventory Management  6/1/1998 12:00:00 AM 
Research and Development  Research and Development  6/1/1998 12:00:00 AM 
Production  Manufacturing  6/1/1998 12:00:00 AM 
Production Control  Manufacturing  6/1/1998 12:00:00 AM 
Human Resources  Executive General and Administration  6/1/1998 12:00:00 AM 
10  Finance  Executive General and Administration  6/1/1998 12:00:00 AM 

Code

CREATE TABLE [HumanResources].[Department](
    [DepartmentID] [smallint] IDENTITY(1,1) NOT NULL,
    [Name] [dbo].[Name] NOT NULL,
    [DepartmentID] [smallint] IDENTITY(1,1) NOT NULL,
    [GroupName] [dbo].[Name] NOT NULL,
    [ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Department_DepartmentID] PRIMARY KEY CLUSTERED 
(
    [DepartmentID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [HumanResources].[Department] ADD  CONSTRAINT [DF_Department_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]

Powered by Yoyodyne © 1971