CREATE TABLE [dbo].[mst_Empl_Department](
[Id] [int] IDENTITY(1,1) NOT NULL,
[EffecitveDate] [datetime] NOT NULL,
[mst_Employee_Id] [int] NOT NULL,
[mst_Department_Id] [int] NOT NULL,
CONSTRAINT [PK_mst_Empl_Department] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[mst_Empl_Department] WITH CHECK ADD CONSTRAINT [FK_mst_Departmentmst_Empl_Department] FOREIGN KEY([mst_Department_Id])
REFERENCES [dbo].[mst_Department] ([Id])
GO
ALTER TABLE [dbo].[mst_Empl_Department] CHECK CONSTRAINT [FK_mst_Departmentmst_Empl_Department]
GO
ALTER TABLE [dbo].[mst_Empl_Department] WITH CHECK ADD CONSTRAINT [FK_mst_Employeemst_Empl_Department] FOREIGN KEY([mst_Employee_Id])
REFERENCES [dbo].[mst_Employee] ([Id])
GO
ALTER TABLE [dbo].[mst_Empl_Department] CHECK CONSTRAINT [FK_mst_Employeemst_Empl_Department]
GO
Above table is Employee related to department table