Northwind Database (Document! X Sample)
AdventureWorks Database / Sales Schema / Sales.SalesTaxRate Table
In This Topic
    Sales.SalesTaxRate Table
    In This Topic
    Description
    Tax rate lookup table.
    Properties
    Creation Date27/10/2017 14:33
    File GroupPRIMARY
    Text File Group
    System Object
    Published for Replication
    Rows29
    Data Space Used8.00 KB
    Index Space Used40.00 KB
    Columns
     Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
    Primary Key Primary key for SalesTaxRate records.Integer4   
     State, province, or country/region the sales tax applies to.Integer4   
     1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions.UnsignedTinyInt1   
     Tax rate amount.Currency8 
    ((0.00))
     
     Tax rate description.dbo.Name50   
     ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.GUID16 
    (newid())
     
     Date and time the record was last updated.DBTimeStamp4 
    (getdate())
     
    Indexes
    IndexDescriptionPrimaryUnique
    Unique nonclustered index. Used to support replication samples. 
    Unique nonclustered index. 
    Primary key (clustered) constraint
    Check Constraints
    NameDescriptionExpression
    Check constraint [TaxType] BETWEEN (1) AND (3)
    ([TaxType]>=(1) AND [TaxType]<=(3))
    Relationships
    RelationshipDescription
    Foreign key constraint referencing StateProvince.StateProvinceID.
    Objects that Sales.SalesTaxRate depends on
     Database ObjectObject TypeDescriptionDep Level
    Person.CountryRegion tablePerson.CountryRegionTableLookup table containing the ISO standard codes for countries and regions.4
    dbo.Flag datatypedbo.FlagUser Defined Data Type 4
    dbo.Name datatypedbo.NameUser Defined Data Type 2
    Sales.SalesTerritory tableSales.SalesTerritoryTableSales territory lookup table.3
    Person.StateProvince tablePerson.StateProvinceTableState and province lookup table.1
    SQL
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [Sales].[SalesTaxRate](
        [SalesTaxRateID] [int] IDENTITY(1,1) NOT NULL,
        [StateProvinceID] [int] NOT NULL,
        [TaxType] [tinyint] NOT NULL,
        [TaxRate] [smallmoney] NOT NULL,
        [Name] [dbo].[Name] NOT NULL,
        [rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
        [ModifiedDate] [datetime] NOT NULL,
     CONSTRAINT [PK_SalesTaxRate_SalesTaxRateID] PRIMARY KEY CLUSTERED 
    (
        [SalesTaxRateID] 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 [Sales].[SalesTaxRate] ADD  CONSTRAINT [DF_SalesTaxRate_TaxRate]  DEFAULT ((0.00)) FOR [TaxRate]
    ALTER TABLE [Sales].[SalesTaxRate] ADD  CONSTRAINT [DF_SalesTaxRate_rowguid]  DEFAULT (newid()) FOR [rowguid]
    ALTER TABLE [Sales].[SalesTaxRate] ADD  CONSTRAINT [DF_SalesTaxRate_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
    ALTER TABLE [Sales].[SalesTaxRate]  WITH CHECK ADD  CONSTRAINT [FK_SalesTaxRate_StateProvince_StateProvinceID] FOREIGN KEY([StateProvinceID])
    REFERENCES [Person].[StateProvince] ([StateProvinceID])
    ALTER TABLE [Sales].[SalesTaxRate] CHECK CONSTRAINT [FK_SalesTaxRate_StateProvince_StateProvinceID]
    ALTER TABLE [Sales].[SalesTaxRate]  WITH CHECK ADD  CONSTRAINT [CK_SalesTaxRate_TaxType] CHECK  (([TaxType]>=(1) AND [TaxType]<=(3)))
    ALTER TABLE [Sales].[SalesTaxRate] CHECK CONSTRAINT [CK_SalesTaxRate_TaxType]
    See Also