Database reference - AdventureWorks

AdventureWorks -  tables -  [Purchasing].[ShipMethod]

Description

Shipping company lookup table. 

Table properties

namevalue
name[Purchasing].[ShipMethod]
createdMar 19 2009 9:08PM
modifiedMar 19 2009 9:08PM 
ansi nullson 
quoted identifieron 
row count5
Size of data8 kb
Size of indexes40 kb
Maximum size of a single row244 bytes

Columns

columndatatypelengthbytesdefaultnullsPKFKUQcomputedcomment
ShipMethodIDint identity(1,1)104 no  yes    no  Primary key for ShipMethod records. 
NameName50200 no      no  Shipping company name. 
ShipBasemoney198((0.00))no      no  Minimum shipping charge. 
ShipRatemoney198((0.00))no      no  Shipping charge per pound. 
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_ShipMethod_Namenonclustered, unique located on PRIMARYNameUnique nonclustered index. 
AK_ShipMethod_rowguidnonclustered, unique located on PRIMARYrowguidUnique nonclustered index. Used to support replication samples. 
PK_ShipMethod_ShipMethodIDclustered, unique, primary key located on PRIMARYShipMethodIDClustered index created by a primary key constraint. 

Referenced by

name
PurchaseOrderHeader
SalesOrderHeader

Foreign key graph

ShipMethodPurchaseOrderHeaderSalesOrderHeader

Check constraints

namecolumncomment
CK_ShipMethod_ShipBaseShipBase    Check constraint [ShipBase] > (0.00) 
CK_ShipMethod_ShipRateShipRate    Check constraint [ShipRate] > (0.00) 

Defaults

default namecolumncomment
DF_ShipMethod_ShipBaseShipBaseDefault constraint value of 0.0 
DF_ShipMethod_ShipRateShipRateDefault constraint value of 0.0 
DF_ShipMethod_rowguidrowguidDefault constraint value of NEWID() 
DF_ShipMethod_ModifiedDateModifiedDateDefault constraint value of GETDATE() 

Dependency graph

DF_ShipMethod_ModifiedDateDF_ShipMethod_rowguidDF_ShipMethod_ShipBaseDF_ShipMethod_ShipRateNameShipMethodCK_ShipMethod_ShipBaseCK_ShipMethod_ShipRateAK_ShipMethod_NameAK_ShipMethod_rowguidPK_ShipMethod_ShipMethodID...

Objects that [Purchasing].[ShipMethod] depends on

nameobject typelevel
Nametype1

Sample rows

ShipMethodIDNameShipBaseShipRaterowguidModifiedDate
XRQ - TRUCK GROUND  3.9500  0.9900  6be756d9-d7be-4463-8f2c-ae60c710d606  6/1/1998 12:00:00 AM 
ZY - EXPRESS  9.9500  1.9900  3455079b-f773-4dc6-8f1e-2a58649c4ab8  6/1/1998 12:00:00 AM 
OVERSEAS - DELUXE  29.9500  2.9900  22f4e461-28cf-4ace-a980-f686cf112ec8  6/1/1998 12:00:00 AM 
OVERNIGHT J-FAST  21.9500  1.2900  107e8356-e7a8-463d-b60c-079fff467f3f  6/1/1998 12:00:00 AM 
CARGO TRANSPORT 5  8.9900  1.4900  b166019a-b134-4e76-b957-2b0490c610ed  6/1/1998 12:00:00 AM 

Code

CREATE TABLE [Purchasing].[ShipMethod](
    [ShipMethodID] [int] IDENTITY(1,1) NOT NULL,
    [Name] [dbo].[Name] NOT NULL,
    [ShipMethodID] [int] IDENTITY(1,1) NOT NULL,
    [ShipBase] [money] NOT NULL,
    [ShipRate] [money] NOT NULL,
    [rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
    [ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_ShipMethod_ShipMethodID] PRIMARY KEY CLUSTERED 
(
    [ShipMethodID] 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 [Purchasing].[ShipMethod]  WITH CHECK ADD  CONSTRAINT [CK_ShipMethod_ShipBase] CHECK  (([ShipBase]>(0.00)))
ALTER TABLE [Purchasing].[ShipMethod] CHECK CONSTRAINT [CK_ShipMethod_ShipBase]
ALTER TABLE [Purchasing].[ShipMethod]  WITH CHECK ADD  CONSTRAINT [CK_ShipMethod_ShipRate] CHECK  (([ShipRate]>(0.00)))
ALTER TABLE [Purchasing].[ShipMethod] CHECK CONSTRAINT [CK_ShipMethod_ShipRate]
ALTER TABLE [Purchasing].[ShipMethod] ADD  CONSTRAINT [DF_ShipMethod_ShipBase]  DEFAULT ((0.00)) FOR [ShipBase]
ALTER TABLE [Purchasing].[ShipMethod] ADD  CONSTRAINT [DF_ShipMethod_ShipRate]  DEFAULT ((0.00)) FOR [ShipRate]
ALTER TABLE [Purchasing].[ShipMethod] ADD  CONSTRAINT [DF_ShipMethod_rowguid]  DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Purchasing].[ShipMethod] ADD  CONSTRAINT [DF_ShipMethod_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]

Powered by Yoyodyne © 1971