我有这些表
create table Town (
Town varchar(50) not null,
Province varchar(50) not null,
constraint PK_Town primary key (Town)
)
create table Streetpart (
Zipcode varchar(6) not null,
Town varchar(50) not null,
Street varchar(50) not null,
constraint PK_Streetpart primary key (ZipCode),
constraint FK_Streetpart foreign key (Town) references TOWN(Town)
)
create table ADRES (
Zipcode varchar(6) not null,
Housenumeber int not null,
constraint PK_ADRES primary key (Zipcode, Housenumber),
constraint FK_ADRES foreign key (Zipcode) references Streetpart(Zipcode)
)
我怎样才能确定只有 Zipcode 属于 Street , Housenumber 和 Town 。
For example:
Street Housenumber Zipcode Town
Port du Louvre 12 1234AB Paris
Port du Louvre 12 5432PQ Paris
是不允许的。
thanx求助。