CREATE TABLE [dbo].[Prod_Familias_Sucursales](
	[Id_Familia] int NOT NULL,
	[Id_Sucursal] Smallint NOT NULL,
	[Stk_Optimo] Decimal(12,2) NULL,
	[Stk_Minimo] Decimal(12,2) NULL, 
 CONSTRAINT [PK_PFSu_PorId] PRIMARY KEY CLUSTERED 
(
	[Id_Familia] ASC,
    [Id_Sucursal] ASC)

) ON [PRIMARY]
GO
 
ALTER TABLE [dbo].[Prod_Familias_Sucursales]  WITH CHECK ADD  CONSTRAINT [FK_PFSu_Sucursal] FOREIGN KEY([Id_Sucursal])
REFERENCES [dbo].[Empresas_Suc] ([Id_Sucursal])
GO

ALTER TABLE [dbo].[Prod_Familias_Sucursales] CHECK CONSTRAINT [FK_PFSu_Sucursal]
GO

ALTER TABLE [dbo].[Prod_Familias_Sucursales]  WITH CHECK ADD  CONSTRAINT [FK_PFSu_Prod_Familias] FOREIGN KEY([Id_Familia])
REFERENCES [dbo].[Prod_Familias] ([Id_Familia])
GO

ALTER TABLE [dbo].[Prod_Familias_Sucursales] CHECK CONSTRAINT [FK_PFSu_Prod_Familias]
GO
 