CREATE TABLE [dbo].[grpzon_zones]
(
[zonz_zone_id] [int] NOT NULL,
[zonz_group_code] [dbo].[ais_code_short] NOT NULL,
[zonz_country_code] [dbo].[ais_code_short] NOT NULL,
[zonz_postcode_code] [dbo].[ais_code_medium] NOT NULL,
[zonz_order] [smallint] NOT NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[grpzon_zones] ADD 
CONSTRAINT [PK_grpzon_zones] PRIMARY KEY CLUSTERED  ([zonz_zone_id]) ON [PRIMARY]
CREATE UNIQUE NONCLUSTERED INDEX [IX_grpzon_zones] ON [dbo].[grpzon_zones] ([zonz_group_code], [zonz_country_code], [zonz_postcode_code], [zonz_order]) ON [PRIMARY]






GO

ALTER TABLE [dbo].[grpzon_zones] ADD CONSTRAINT [FK_grpzon_zones_nm_countries] FOREIGN KEY ([zonz_country_code]) REFERENCES [dbo].[nm_countries] ([nmctr_country_code])
GO

ALTER TABLE [dbo].[grpzon_zones] ADD CONSTRAINT [FK_grpzon_zones_grpzon_groups] FOREIGN KEY ([zonz_group_code]) REFERENCES [dbo].[grpzon_groups] ([zong_group_code])
GO
