Microsoft sql banners table

MySQL Server -- Posted on Oct. 24, 2020

Microsoft SQL banners table

              
                CREATE TABLE Banners (
    Id int IDENTITY(1,1) not null,
    [Order] int not null default 0,
    Location int not null,
    CreatedAt datetime not null DEFAULT GETDATE(),
    UpdatedAt datetime not null DEFAULT GETDATE(),
    Published bit not null default 0,
    Deleted bit not null default 0,
    BannerImagePath nvarchar(max) NULL,
    BannerCode nvarchar(max) NULL,
    CONSTRAINT PK_Banners_Id PRIMARY KEY CLUSTERED (Id),
);


CREATE TABLE BannersStatistics (
    Id int IDENTITY(1,1) not null,
    SessionId nvarchar(max) null,
    BannersId int not null,
    CreatedAt datetime not null DEFAULT GETDATE(),
    CONSTRAINT PK_Banners_Id PRIMARY KEY CLUSTERED (Id),
    CONSTRAINT FK_BannersStatistics_BannersId FOREIGN KEY (BannersId) REFERENCES  Banners(Id),
);
                  
   
            

Related Posts