test=# create table emails(id serial primary key, mail text);
NOTICE: CREATE TABLE will create implicit sequence "emails_id_seq" for serial column "emails.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "emails_pkey" for table "emails"
CREATE TABLE
Time: 24,478 ms
test=*# create table t_orga (id serial primary key, name text);
NOTICE: CREATE TABLE will create implicit sequence "t_orga_id_seq" for serial column "t_orga.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t_orga_pkey" for table "t_orga"
CREATE TABLE
Time: 22,516 ms
test=*# create table t_pos (id serial primary key, name text);
NOTICE: CREATE TABLE will create implicit sequence "t_pos_id_seq" for serial column "t_pos.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t_pos_pkey" for table "t_pos"
CREATE TABLE
Time: 6,478 ms
test=*# create table t_pers (id serial primary key, name text);
NOTICE: CREATE TABLE will create implicit sequence "t_pers_id_seq" for serial column "t_pers.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t_pers_pkey" for table "t_pers"
CREATE TABLE
Time: 11,997 ms
test=*# create table t_pers_mail(pers_id int references t_pers, mail int references emails, primary key(pers_id, mail));
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t_pers_mail_pkey" for table "t_pers_mail"
CREATE TABLE
Time: 121,040 ms
[/code
Analog zur letzten Tabelle noch t_pos_mail und t_orga_mail. Du wirst also 3 'Hilfstabellen' brauchen, kannst aber alles zuordnen. Eine Mailadresse kann so also auch zu 2 oder 3 Gebieten gehören.
Syntax ist PostgreSQL, wie üblich ;-)