Database reference - AdventureWorks

AdventureWorks -  tables -  [Production].[ProductCategory]

Description

High-level product categorization. 

Table properties

namevalue
name[Production].[ProductCategory]
createdMar 19 2009 9:08PM
modifiedMar 19 2009 9:08PM 
ansi nullson 
quoted identifieron 
row count4
Size of data8 kb
Size of indexes40 kb
Maximum size of a single row228 bytes

Columns

columndatatypelengthbytesdefaultnullsPKFKUQcomputedcomment
ProductCategoryIDint identity(1,1)104 no  yes    no  Primary key for ProductCategory records. 
NameName50200 no      no  Category description. 
rowguiduniqueidentifier3616(newid())no      no  ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. 
ModifiedDatedatetime238(getdate())no      no  Date and time the record was last updated. 

Indexes

namedescriptioncolumncomment
AK_ProductCategory_Namenonclustered, unique located on PRIMARYNameUnique nonclustered index. 
AK_ProductCategory_rowguidnonclustered, unique located on PRIMARYrowguidUnique nonclustered index. Used to support replication samples. 
PK_ProductCategory_ProductCategoryIDclustered, unique, primary key located on PRIMARYProductCategoryIDClustered index created by a primary key constraint. 

Referenced by

name
ProductSubcategory

Foreign key graph

ProductCategoryProductSubcategory

Defaults

default namecolumncomment
DF_ProductCategory_rowguidrowguidDefault constraint value of NEWID()() 
DF_ProductCategory_ModifiedDateModifiedDateDefault constraint value of GETDATE() 

Dependency graph

DF_ProductCategory_ModifiedDateDF_ProductCategory_rowguidNameProductCategoryAK_ProductCategory_Name...AK_ProductCategory_rowguid...PK_ProductCategory_ProductCategoryID...

Objects that [Production].[ProductCategory] depends on

nameobject typelevel
Nametype1

Sample rows

ProductCategoryIDNamerowguidModifiedDate
Bikes  cfbda25c-df71-47a7-b81b-64ee161aa37c  6/1/1998 12:00:00 AM 
Components  c657828d-d808-4aba-91a3-af2ce02300e9  6/1/1998 12:00:00 AM 
Clothing  10a7c342-ca82-48d4-8a38-46a2eb089b74  6/1/1998 12:00:00 AM 
Accessories  2be3be36-d9a2-4eee-b593-ed895d97c2a6  6/1/1998 12:00:00 AM 

Code

CREATE TABLE [Production].[ProductCategory](
    [ProductCategoryID] [int] IDENTITY(1,1) NOT NULL,
    [Name] [dbo].[Name] NOT NULL,
    [ProductCategoryID] [int] IDENTITY(1,1) NOT NULL,
    [rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
    [ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_ProductCategory_ProductCategoryID] PRIMARY KEY CLUSTERED 
(
    [ProductCategoryID] 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 [Production].[ProductCategory] ADD  CONSTRAINT [DF_ProductCategory_rowguid]  DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Production].[ProductCategory] ADD  CONSTRAINT [DF_ProductCategory_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]

Powered by Yoyodyne © 1971