default

Romber

Database tables

romber_location.country_postal_zones

Purpose

This table provides a list of valid country postal zones which can be selected by web site users. This information is static and doesn't need a data entry page.

Definition

Source romber_country_postal_zones_tbl.sql

create table romber_location.country_postal_zones (
  country_id                    romber_location.location_id     not null,
  country_postal_zone_code      romber_base.generic_code        not null,
  country_postal_zone_id        romber_location.location_id     not null );

Constraints

Source romber_country_postal_zones_pk.sql

alter table romber_location.country_postal_zones
  add constraint romber_country_postal_zones_pk
    primary key ( country_postal_zone_id );

Source romber_country_postal_zones_uk1.sql

alter table romber_location.country_postal_zones
  add constraint romber_country_postal_zones_uk1
    unique (
      country_id,
      country_postal_zone_code );

Source romber_country_postal_zones_fk1.sql

alter table romber_location.country_postal_zones
  add constraint romber_country_postal_zones_fk1
    foreign key ( country_postal_zone_id )
    references romber_location.locations ( location_id );

Source romber_country_postal_zones_fk2.sql

alter table romber_location.country_postal_zones
  add constraint romber_country_postal_zones_fk2
    foreign key ( country_id )
    references romber_location.countries ( country_id );

Load

Source romber_country_postal_zones_load.sql

insert into romber_location.country_postal_zones (
    country_id,
    country_postal_zone_code,
    country_postal_zone_id )
  values (
    0,
    '',
    0 );

 

Copyright © Corpita Pty Ltd 1987 - 2024

Developed by romber.net
Page modified on 28-Apr-2023