Description
Product subcategories. See ProductCategory table.
Table properties
| name | value |
|---|
| name | [Production].[ProductSubcategory] |
| created | Mar 19 2009 9:09PM |
| modified | Mar 19 2009 9:10PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 37 |
| Size of data | 8 kb |
| Size of indexes | 40 kb |
| Maximum size of a single row | 232 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| ProductSubcategoryID | int identity(1,1) | 10 | 4 | | no
| yes
| |
| no
| Primary key for ProductSubcategory records.
|
| ProductCategoryID | int | 10 | 4 | | no
|
| ProductCategory.ProductCategoryID
|
| no
| Product category identification number. Foreign key to ProductCategory.ProductCategoryID.
|
| Name | Name | 50 | 200 | | no
|
| |
| no
| Subcategory description.
|
| rowguid | uniqueidentifier | 36 | 16 | (newid()) | no
|
| |
| no
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
References
Referenced by
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_ProductSubcategory_ProductCategory_ProductCategoryID | ProductCategoryID | ProductCategory.ProductCategoryID |
| Foreign key constraint referencing ProductCategory.ProductCategoryID.
|
Defaults
Dependency graph
Objects that [Production].[ProductSubcategory] depends on
| name | object type | database | server | level |
|---|
| Name | type | AdventureWorks2008 | SPRING\KATMAI | 1 |
Objects that depend on [Production].[ProductSubcategory]
Sample rows
| ProductSubcategoryID | ProductCategoryID | Name | rowguid | ModifiedDate |
|---|
| 1
| 1
| Mountain Bikes
| 2d364ade-264a-433c-b092-4fcbf3804e01
| 6/1/1998 12:00:00 AM
|
| 2
| 1
| Road Bikes
| 000310c0-bcc8-42c4-b0c3-45ae611af06b
| 6/1/1998 12:00:00 AM
|
| 3
| 1
| Touring Bikes
| 02c5061d-ecdc-4274-b5f1-e91d76bc3f37
| 6/1/1998 12:00:00 AM
|
| 4
| 2
| Handlebars
| 3ef2c725-7135-4c85-9ae6-ae9a3bdd9283
| 6/1/1998 12:00:00 AM
|
| 5
| 2
| Bottom Brackets
| a9e54089-8a1e-4cf5-8646-e3801f685934
| 6/1/1998 12:00:00 AM
|
| 6
| 2
| Brakes
| d43ba4a3-ef0d-426b-90eb-4be4547dd30c
| 6/1/1998 12:00:00 AM
|
| 7
| 2
| Chains
| e93a7231-f16c-4b0f-8c41-c73fdec62da0
| 6/1/1998 12:00:00 AM
|
| 8
| 2
| Cranksets
| 4f644521-422b-4f19-974a-e3df6102567e
| 6/1/1998 12:00:00 AM
|
| 9
| 2
| Derailleurs
| 1830d70c-aa2a-40c0-a271-5ba86f38f8bf
| 6/1/1998 12:00:00 AM
|
| 10
| 2
| Forks
| b5f9ba42-b69b-4fdd-b2ec-57fb7b42e3cf
| 6/1/1998 12:00:00 AM
|
Code
CREATE TABLE [Production].[ProductSubcategory](
[ProductSubcategoryID] [int] IDENTITY(1,1) NOT NULL,
[ProductCategoryID] [int] NOT NULL,
[Name] [dbo].[Name] NOT NULL,
[ProductSubcategoryID] [int] IDENTITY(1,1) NOT NULL,
[ProductCategoryID] [int] NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_ProductSubcategory_ProductSubcategoryID] PRIMARY KEY CLUSTERED
(
[ProductSubcategoryID] 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].[ProductSubcategory] WITH CHECK ADD CONSTRAINT [FK_ProductSubcategory_ProductCategory_ProductCategoryID] FOREIGN KEY([ProductCategoryID])
REFERENCES [Production].[ProductCategory] ([ProductCategoryID])
ALTER TABLE [Production].[ProductSubcategory] CHECK CONSTRAINT [FK_ProductSubcategory_ProductCategory_ProductCategoryID]
ALTER TABLE [Production].[ProductSubcategory] ADD CONSTRAINT [DF_ProductSubcategory_rowguid] DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Production].[ProductSubcategory] ADD CONSTRAINT [DF_ProductSubcategory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]