Coupon

The Coupon table is designed to store information about coupons. It includes columns for the brand ID, coupon code, description, percentage value, quantity, start date, end date, auto-apply-to-price flag, status, and flags to indicate the user who created or last modified the coupon, along with the corresponding date and time.

Table Structure
  • [ID] (bigint, auto-incrementing, primary key): Represents the unique identifier for each coupon.

  • [Brand_ID] (bigint, not null): Represents the brand associated with the coupon.

  • [Coupon_Code] (varchar(50), not null): Represents the code for the coupon.

  • [Description] (nvarchar(250), nullable): Represents the description of the coupon.

  • [Coupon_Percent] (float, not null): Represents the percentage value of the coupon.

  • [Quantity] (int, nullable): Represents the quantity of the coupon.

  • [Start_Date] (datetime, not null): Represents the start date of the coupon.

  • [End_Date] (datetime, not null): Represents the end date of the coupon.

  • [Auto_Apply_To_Price] (bit, not null): Indicates whether the coupon should be automatically applied to the price.

  • [Status] (smallint, not null): Represents the status of the coupon.

  • [Modified_By] (bigint, nullable): Represents the user who last modified the coupon.

  • [Modified_Date] (datetime, not null): Represents the date and time when the coupon was last modified.

  • [Created_By] (bigint, not null): Represents the user who created the coupon.

  • [Created_Date] (datetime, not null): Represents the date and time when the coupon was created.

Constraints
  • [PK_Coupon]: Primary key constraint on the [ID] column.

  • [DF_Coupon_Status]: Default constraint on the [Status] column, default value is 1.

  • [DF_Coupon_ModifiedDate]: Default constraint on the [Modified_Date] column, default value is the current UTC date and time.

  • [DF_Coupon_CreatedDate]: Default constraint on the [Created_Date] column, default value is the current UTC date and time.

Example Data

Brand_ID
Coupon_Code
Description
Coupon_Percent
Quantity
Start_Date
End_Date
Auto_Apply_To_Price
Status

1

10OFF

10% off

10.00

NULL

2024-01-01

2024-12-31

1

1

1

20OFF

20% off

20.00

90

2024-01-01

2024-12-31

1

1

1

30OFF

30% off

30.00

10

2024-01-01

2024-12-31

1

1

Last updated

Was this helpful?